編輯:高級開發
AutoBootReceiver.Java 文件:
Java代碼
1.package com.ldq.auto.boot;
2.
3.import android.content.BroadcastReceiver;
4.import android.content.Context;
5.import android.content.Intent;
6.import android.util.Log;
7.
8.public class AutoBootReceiver extends BroadcastReceiver {
9.
10. @Override
11. public void onReceive(Context context, Intent intent) {
12. // TODO Auto-generated method stub
13. if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
14. Log.i("------", "AutoBootReceiver auto boot");
15. Intent in = new Intent(context, ExAutoBoot.class);
16. in.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//添加Flags必不可少,否則報錯
17. context.startActivity(in);
18. }
19. }
20.}
package com.ldq.auto.boot;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class AutoBootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
Log.i("------", "AutoBootReceiver auto boot");
Intent in = new Intent(context, ExAutoBoot.class);
in.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//添加Flags必不可少,否則報錯
context.startActivity(in);
}
}
}
ExAutoBoot.Java 文件:
Java代碼
1.package com.ldq.auto.boot;
2.
3.import android.app.Activity;
接上頁
4.import android.os.Bundle;
5.import android.util.Log;
6.
7.public class ExAutoBoot extends Activity {
8. /** Called when the activity is first created. */
9. @Override
10. public void onCreate(Bundle savedInstanceState) {
11. super.onCreate(savedInstanceState);
12. setContentVIEw(R.layout.main);
13. Log.i("------","ExAutoBoot auto boot");
14. }
15.}
package com.ldq.auto.boot;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class ExAutoBoot extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentVIEw(R.layout.main);
Log.i("------","ExAutoBoot auto boot");
}
}
androidManifest.XML 文件:
Java代碼
1.< ?XML version="1.0" encoding="utf-8"?>
2.< manifest XMLns:android="http://schemas.android.com/apk/res/android"
3. package="com.ldq.auto.boot" android:versionCode="1"
4. android:versionName="1.0">
5. < application android:icon="@drawable/icon" android:label="@string/app_name">
6. < activity android:name=".ExAutoBoot" android:label="@string/app_name">
7. < intent-filter>
8. < action android:name="android.intent.action.MAIN" />
9. < category android:name="android.intent.category.LAUNCHER" />
10. < /intent-filter>
11. < /activity>
12. < receiver android:name="AutoBootReceiver">
13. < intent-filter>
14. < action android:name="android.intent.action.BOOT_COMPLETED">< /action>
15. < /intent-filter>
16. < /receiver>
17. < /application>
18. < uses-sdk android:minSdkVersion="4" />
19. < uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED">< /uses-permission>
20.< /manifest>
谷歌傾力打造的android系統平台智能手機操作系統,而相應的終端OPhone也已經推出了近十款之多。那麼隨著谷歌及android系統可能面臨的變動,OPhone自然也
用戶卻不會喜愛它們。在移動應用中,簡潔明快才是用戶希望看到的。試想一下,當用戶在手機上玩一個RPG游戲,並被華麗的3D效果充斥了整個界面,那麼他將完全無法著手進行下一個
盡管蘋果聯合創始人承認:android將取得最終勝利,不過很多人認為過於開放的環境依然不利於android,無差異的應用體驗正在制約Android超過iPhone。日前
由於android平台本身的優勢,引來了很多手機廠商的關注。 一大堆 android 手機發售在即,開發人員向該平台投入了巨大的資源,這可能會迎來 android程序的