I want to load activity from the BroadcastReceiver onReceive method. I have 2 types of activity, one of them is the main one and the second one I created. I want to load the second action from onReceive , but it loads the main action, and I don't know why ..
This is the onReceive() intent:
Intent i = new Intent(context, BTNotifierWarning.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i);
this is the BTNotifierWarning class:
package com.btnotifier; import android.app.Activity; import android.os.Bundle; public class BTNotifierWarning extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.warning);
and this is the xml warning layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".BTNotifierWarning" >
Why is this happening?
Thanks!
source share