Inside the broadcast receiver, I want to run my application (Activity) and transfer some data.
My problem is that the extra features do not seem to carry over into this activity. I am trying to get data inside a function onNewIntent(Intent i).
Any ideas?
Here is my current attempt at BroadcastReceiver :
Intent intSlider = new Intent();
intSlider.setClass(UAirship.shared().getApplicationContext(), SliderMenuActivity.class);
intSlider.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intSlider.putExtra("action", ScreensEnum.Object);
intSlider.putExtra("objectId", objectId);
intSlider.putExtra("objectCode", objectCode);
intSlider.putExtra("userId", userId);
UAirship.shared().getApplicationContext().startActivity(intSlider);
EDIT - Added code used in onNewIntent () and onCreate ()
The following code works fine onCreate()when the application is down. When the application is already running, the same code does not work (i.e. No additional functions) from the function onNewIntent().
Intent intent = getIntent();
if(intent.hasExtra("objectId")) {
loadDetail(intent.getStringExtra("objectId"), "2w232");
}
source
share