Click here to Skip to main content
15,885,881 members
Home / Discussions / Android
   

Android

 
AnswerRe: full source code for doctor appointment app Pin
Ravi Bhavnani30-Dec-16 6:54
professionalRavi Bhavnani30-Dec-16 6:54 
AnswerRe: full source code for doctor appointment app Pin
Richard MacCutchan30-Dec-16 21:10
mveRichard MacCutchan30-Dec-16 21:10 
GeneralRe: full source code for doctor appointment app Pin
Member 1437349415-May-19 21:50
Member 1437349415-May-19 21:50 
Questionsimpe doctor appointment app Pin
Member 1292829230-Dec-16 1:26
Member 1292829230-Dec-16 1:26 
AnswerRe: simpe doctor appointment app Pin
Peter Leow30-Dec-16 1:48
professionalPeter Leow30-Dec-16 1:48 
AnswerRe: simpe doctor appointment app Pin
Ravi Bhavnani30-Dec-16 6:56
professionalRavi Bhavnani30-Dec-16 6:56 
AnswerRe: simpe doctor appointment app Pin
Member 149880838-May-21 13:55
Member 149880838-May-21 13:55 
QuestionActivity Not opening from the notification bar Pin
Shanmugapriya D12-Dec-16 23:48
Shanmugapriya D12-Dec-16 23:48 
C#
Expecting : I am displaying more than one notification in Notification bar. In this notification i have three button like 1, 2 and 3. From the notification if click 1 button then it has to go the first activity if click 2 button it has to go second activity same like 3 button also.

But i am stuck below:

1. displaying more than one notification => No problem 2. But if i click 1 st button it is going the 1st activity.(Now app is opening) again when i click the 1 st button some other notification as displayed in notification status bar it not opening the 1st activity

AirshipReceiver(Push Receiver)

Java
@Override
protected boolean onNotificationOpened(@NonNull Context context, @NonNull NotificationInfo notificationInfo, @NonNull ActionButtonInfo actionButtonInfo) {
    Log.i(TAG, "Notification action button opened. Button ID: " + actionButtonInfo.getButtonId() + ". NotificationId: " + notificationInfo.getNotificationId());
    Toast.makeText(context.getApplicationContext(),"Button Click",Toast.LENGTH_LONG).show();
    Log.e("@@@@@@@ID", String.valueOf(notificationInfo.getNotificationId()));
    Log.e("$$", String.valueOf(notificationInfo.getMessage().getAlert()));
    Log.e("eGSSSHKJHSHJS", (String) notificationInfo.getMessage().getPushBundle().get("AlarmJson"));
    String pushjson=(String) notificationInfo.getMessage().getPushBundle().get("AlarmJson");
    if(actionButtonInfo.getButtonId()!=null && actionButtonInfo.getButtonId().equalsIgnoreCase("Graph")) {
        Log.e("Graph","You clicked Graph");
        Toast.makeText(context.getApplicationContext(),"Graph Click",Toast.LENGTH_LONG).show();
        Intent i = new Intent(context.getApplicationContext(), **ResultActivity**.class);
        i.putExtra("From", "from@@#graphicViewRoute");
        i.putExtra("Pushjson","json@@"+pushjson);
        //i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK |Intent.FLAG_ACTIVITY_CLEAR_TOP |Intent.FLAG_ACTIVITY_SINGLE_TOP);


        context.startActivity(i);

        return true;

    }
    else if(actionButtonInfo.getButtonId()!=null && actionButtonInfo.getButtonId().equalsIgnoreCase("DD"))
    {
        Log.e("DD","You clicked DD");
        Intent i = new Intent(context.getApplicationContext(), **ResultActivity**.class);
        i.putExtra("From", "from@@#ddviewRoute");
        i.putExtra("Pushjson","json@@"+pushjson);
        i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
        i.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(i);

        return true;

    }

    // Return false here to allow Urban Airship to auto launch the launcher
    // activity for foreground notification action buttons
    return false;
}



ResultActivity.class:

Java
public class ResultActivity extends CordovaActivity{
public static boolean mIsInForegroundMode;
public static String PREF_FILE = "eG_sp";
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    Log.e("ResultActivity","You ResultActivity");
    Bundle extras = getIntent().getExtras();
    String pushPage = extras.getString("From");
    String pushJSON = extras.getString("Pushjson");
    Toast.makeText(getApplicationContext(),"ResultActivity Click",Toast.LENGTH_LONG).show();
    Log.e("ResultActivity",pushPage+pushJSON);

    //super.loadUrl("file:///android_asset/www/index.html");
    SharedPreferences.Editor editor = getSharedPreferences(PREF_FILE, MODE_APPEND).edit();
    editor.putString("pushPage", pushPage);
    editor.putString("pushJSON",pushJSON);
    editor.commit();
    super.loadUrl("file:///android_asset/www/index.html");
}
@Override
protected void onPause(){
    super.onPause();
    mIsInForegroundMode = false;
}
@Override
protected void onResume() {
    super.onResume();
    mIsInForegroundMode=true;
}
@Override
protected void onStop() {
    super.onStop();
    mIsInForegroundMode=false;
}
@Override
protected void onStart() {
    super.onStart();
    mIsInForegroundMode=true;
}
@Override
public void onDestroy() {
    LOG.d(TAG, "CordovaActivity.onDestroy()");
    super.onDestroy();
    mIsInForegroundMode=false;
}
}

QuestionRe: Activity Not opening from the notification bar Pin
Richard MacCutchan13-Dec-16 0:06
mveRichard MacCutchan13-Dec-16 0:06 
AnswerRe: Activity Not opening from the notification bar Pin
Shanmugapriya D13-Dec-16 0:41
Shanmugapriya D13-Dec-16 0:41 
GeneralRe: Activity Not opening from the notification bar Pin
Richard MacCutchan13-Dec-16 5:46
mveRichard MacCutchan13-Dec-16 5:46 
QuestionSpeech to text notepad Pin
Member 108502537-Dec-16 15:30
Member 108502537-Dec-16 15:30 
AnswerRe: Speech to text notepad Pin
Richard MacCutchan7-Dec-16 22:02
mveRichard MacCutchan7-Dec-16 22:02 
QuestionRemote Desktop Mobile app Pin
Member 127953594-Dec-16 2:49
Member 127953594-Dec-16 2:49 
AnswerRe: Remote Desktop Mobile app Pin
Afzaal Ahmad Zeeshan4-Dec-16 3:29
professionalAfzaal Ahmad Zeeshan4-Dec-16 3:29 
QuestionDrawing App CustomView Pin
Member 1065435022-Nov-16 6:58
Member 1065435022-Nov-16 6:58 
AnswerRe: Drawing App CustomView Pin
Richard MacCutchan22-Nov-16 8:36
mveRichard MacCutchan22-Nov-16 8:36 
AnswerRe: Drawing App CustomView Pin
David Crow22-Nov-16 12:51
David Crow22-Nov-16 12:51 
GeneralRe: Drawing App CustomView Pin
Member 1065435022-Nov-16 15:27
Member 1065435022-Nov-16 15:27 
Questionhelp Pin
Karan Malik10-Nov-16 18:34
Karan Malik10-Nov-16 18:34 
AnswerRe: help Pin
Richard MacCutchan10-Nov-16 22:01
mveRichard MacCutchan10-Nov-16 22:01 
AnswerRe: help Pin
ZurdoDev17-Nov-16 0:58
professionalZurdoDev17-Nov-16 0:58 
Questionandroid Pin
Member 128402858-Nov-16 18:52
Member 128402858-Nov-16 18:52 
AnswerRe: android Pin
Richard MacCutchan8-Nov-16 22:42
mveRichard MacCutchan8-Nov-16 22:42 
AnswerRe: android Pin
Rou199730-Nov-16 14:22
Rou199730-Nov-16 14:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.