当收到通知时,当从通知中心单击通知时,我的 android 应用程序会打开,但同时我也想打开我的滑动抽屉。这是我的代码
IntentReceiver.class(自定义推送接收器)
String action = intent.getAction();
if (action.equals(PushManager.ACTION_NOTIFICATION_OPENED)) {
Log.i(logTag, "User clicked notification. Message: " + intent.getStringExtra(PushManager.EXTRA_ALERT));
// logPushExtras(intent);
if(!MainActivity.active){
Intent launch = new Intent(Intent.ACTION_MAIN);
launch.setClass(UAirship.shared().getApplicationContext(), MainActivity.class);
launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
UAirship.shared().getApplicationContext().startActivity(launch);
}
}
}
这是主要活动..
public static boolean active;
我想添加以下内容
final SlidingDrawer banner = (SlidingDrawer) findViewById(R.id.slidingDrawer1);
banner.animateOpen();
谁能告诉我该怎么做。通过通知打开应用程序时打开滑动抽屉。