taskstackbuilder

TaskStackBuilder#startActivities() NullPointerException

让人想犯罪 __ 提交于 2019-12-31 22:22:07
问题 I have a crash that keeps occurring on 4.4.2 and 4.4.3 devices (although I'm not sure this is an API issue), where in some ParsePushBroadcastReceiver the following code causes a NullPointerException somewhere deep inside the startActivities call. Intent intent = new Intent(context, SomeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); TaskStackBuilder.create(context) .addParentStack(SomeActivity.class) .addNextIntent(intent) .startActivities(); I have tried testing to see

TaskStackBuilder transition animation

送分小仙女□ 提交于 2019-12-04 09:50:31
问题 I'm using Android L transitions passing an ActivityOptions bundle in intent. How can I reproduce the animation on the same intent with TaskStackBuilder ? This is my current working method with a single Intent : startActivity(myIntent, ActivityOptions.makeSceneTransitionAnimation(this).toBundle()); This is my try with TaskStackBuilder : TaskStackBuilder builder = TaskStackBuilder.create(this); builder.addNextIntentWithParentStack(myIntent); builder.startActivities(ActivityOptions

Why do we use the TaskStackBuilder?

≯℡__Kan透↙ 提交于 2019-12-03 05:36:13
问题 Why do we use the TaskStackBuilder when creating a notification? I do not get the logic behind it. Can someone please explain. public void showText(final String text){ Intent intent = new Intent (this, MainActivity.class); TaskStackBuilder stackBuilder = TaskStackBuilder.create(this); stackBuilder.addParentStack(MainActivity.class); stackBuilder.addNextIntent(intent); PendingIntent pendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); Notification notification =

TaskStackBuilder#startActivities() NullPointerException

放肆的年华 提交于 2019-12-03 02:59:29
I have a crash that keeps occurring on 4.4.2 and 4.4.3 devices (although I'm not sure this is an API issue), where in some ParsePushBroadcastReceiver the following code causes a NullPointerException somewhere deep inside the startActivities call. Intent intent = new Intent(context, SomeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); TaskStackBuilder.create(context) .addParentStack(SomeActivity.class) .addNextIntent(intent) .startActivities(); I have tried testing to see whether the context was null, however, the Intent instantiation would've caught that. It might also be worth

Why do we use the TaskStackBuilder?

假如想象 提交于 2019-12-02 18:54:30
Why do we use the TaskStackBuilder when creating a notification? I do not get the logic behind it. Can someone please explain. public void showText(final String text){ Intent intent = new Intent (this, MainActivity.class); TaskStackBuilder stackBuilder = TaskStackBuilder.create(this); stackBuilder.addParentStack(MainActivity.class); stackBuilder.addNextIntent(intent); PendingIntent pendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); Notification notification = new Notification.Builder(this) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(getString(R.string