0
我一直致力於訂購出租車的應用程序。 在驅動程序的應用程序中,我推送服務實例2的活動取決於推送內容。如果來自客戶的呼叫在已選擇確認以獲取乘客啓動活動2的情況下啓動活動1.除了活動2能夠啓動呼叫電話或活動三按下各種按鈕,但是每次她發出電話呼叫或活動3當返回回到活動1永遠不會回到我以前的活動後,新的意圖
我的清單看起來像:
<activity
android:label="@string/app_name"
android:name=".MainActivity"
android:screenOrientation="portrait"
android:launchMode="singleTop"
android:alwaysRetainTaskState="true"
android:configChanges="orientation|keyboardHidden|screenSize">
</activity>
<activity
android:label="@string/app_name"
android:name=".RouteActivity"
android:screenOrientation="portrait"
android:alwaysRetainTaskState="true"
android:configChanges="orientation|keyboardHidden|screenSize">
</activity>
我的推送服務;
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("MyTaxi")
.setContentText(msg)
.setUsesChronometer(true);
if(GlobalPersist.getGlobalPersist("tipoPush").equals("nueva")&& GlobalPersist.getGlobalPersist("carreraencurso").equals("false"))
{
Intent notIntent = new Intent(this, MainActivity.class);
MainActivity.from=1;
notIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(notIntent);
}
else if(GlobalPersist.getGlobalPersist("tipoPush").equals("cancelacion"))
{ GlobalPersist.getGlobalPersist("carreraencurso").equals("false");
Intent notIntent = new Intent(this, MainActivity.class);
MainActivity.from=1;
MainActivity.carreras.clear();
notIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP);
this.startActivity(notIntent);
}
else
{
Intent notIntent = new Intent(this, RouteActivity.class);
//MainActivity.from=1;
MainActivity.timer.cancel();
MainActivity.isTimerActivo=false;
notIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|
Intent.FLAG_ACTIVITY_SINGLE_TOP);
this.startActivity(notIntent);
}
已經試過了,它並沒有工作我:( – PabloPasten
你能告訴我你在哪裏打電話完成?沒有理由爲什麼它不應該工作。 – jmcdonnell40