Hi,
I created an application which enables the user to set whether he wants to receive notification while the application runs in background mode. If the notifications are enabled an activity should be started (the dialog should appear on the screen).
I tried to enabled it the following way:
@Override
public void onProductsResponse(List<Product> products) {
this.products = products;
moboolo.setProducts(products);
if(moboolo.getAutomaticNotificationsMode() != 0 && products.size() > 0){
if(isRunningInBackground)
{
Intent intent = new Intent(this, ProductListActivity.class);
intent.setAction(Intent.ACTION_MAIN);
startActivity(intent);
}
}
drawProducts(products);
}
this is the method from main activity. When onPause() is executed isRunningInBackground is set true. When I tried to debug it when the main application was running in the background the line
startActivity(intent) had no effect (the activity didn't appear).
Does anyone know how to midify the logic in order to start an activity from the main activity when the main activity is running in the background (after onPause() is called)?
Thank you.