In my ListProvider
class that implements RemoteViewsFactory
I have putted the following code below:
@Override
public RemoteViews ge
I added setData()
in my onReceive
where I pass data.
@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);
if (intent.getAction().equals(TOAST_ACTION)) {
int appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID);
Intent goToDetails = new Intent(context, DetailsActivity.class);
goToDetails.putExtra(Constants.MERCHANT_ID, intent.getStringExtra(MERCHANT_ITEM) );
goToDetails.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
goToDetails.setData(Uri.parse(goToDetails.toUri(Intent.URI_INTENT_SCHEME)));
context.startActivity(goToDetails);
}
}
But I encounter a crash, if I un-install the app and then install and doesn't open the app first then add a widget
and click on the ListView
.
Found out why it crashes because of my database it still doesn't exist. Because I'm creating my database in my SplashActivity