Broadcast receiver
public void onReceive(Context context, Intent intent) {
// make sure you receive "BOOT_COMPLETED"
String action = "";
if ( intent != null && intent.getAction() != null )
{
action = intent.getAction();
Log.d("[OriReceiver]", "action="+action);
if ( action.equals("android.intent.action.BOOT_COMPLETED") )
{
Intent newIntent = new Intent();
newIntent.setClassName("xxx", "xxxi.Entry");
newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(newIntent);
}
}
}
====================
Entry.java
public void onCreate(Bundle savedInstanceState)
{
init();
}
private void init()
{
Intent intent = new Intent(getBaseContext(), Login.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
finish();
}
The problem is Entry is sometimes called twice. onCreate() is called
twice. Somtimes, onCreate() of Login is called twice.
When the activity is loaded in the phone, i have to unlock it to see
the GUI.
Please help me in this one.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en