I have this Broadcast receiver registered
public class NotifyAlarmBroadcast extends BroadcastReceiver{
public Context context;
public static final String NOTI = "android.intent.action.MAIN";
// actually i want NOTI = "com.sumit.timekeeper.NotifyAlarm"
// this too is not working
// help me here please
@Override
public void onReceive(Context _context, Intent intent) {
context = _context;
Uri data = intent.getData();
String reason = intent.getStringExtra("alarm_reason");
Intent intentalarm = new Intent(NOTI, data);
intentalarm.putExtra("reason", reason);
context.startActivity(intentalarm);
}
}
and the manifest
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".TimeKeeperStartActivity"
android:screenOrientation="portrait" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".NotifyAlarm"
android:screenOrientation="portrait" android:theme="@android:style/Theme.Dialog">
<intent-filter>
<action android:name="com.sumit.timekeeper.NotifyAlarm">
</action>
</intent-filter>
</activity>
<receiver android:name=".NotifyAlarmBroadcast">
<intent-filter>
<action android:name="com.sumit.timekeeper.NotifyAlarmBroadcast" />
</intent-filter>
</receiver>
</application>
but when the line reaches context.startActivity(intentalarm); the application crashes
may be it is where we pass first parameter to Intent, i'm not clear about please help me.