Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4448] Resuming of inactive Activity from module

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionHold
Resolution Date2016-11-15T18:56:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterRainer Schleevoigt
AssigneeShak Hossain
Created2016-09-12T11:31:41.000+0000
Updated2016-11-15T18:56:38.000+0000

Description

Hi, I have built an interactive notification and try to "restart" the "frozen" activity by click. I mean the same action as I click on preview in taskmanager of operating system. In Manifest I see 2 activities: one name with APPNAMEActivity and a second named "org.appcelerator.titanium.TiActivity". If I call an intent to first, then the app will restarted with running of splash intro. But I need the direct jump. Is it possible with Titanium and how? Here the used snippet:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
String packageName = TiApplication.getInstance().getPackageName();
String className = packageName + "." + TiApplication.getAppRootOrCurrentActivity().getLocalClassName();
intent.setComponent(new ComponentName(packageName, className));
PendingIntent pendingIntent = PendingIntent.getActivity(ctx, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);
builder = new NotificationCompat.Builder(ctx);
builder.setSmallIcon(R("notification_icon", "drawable"))
		.setAutoCancel(false).setOngoing(true)
		.setPriority(NotificationCompat.PRIORITY_HIGH)
		.setContentTitle("").setContentText("");

Comments

  1. Rainer Schleevoigt 2016-09-20

    Hi, after some studies I know the way is usage of TaskStackBuilder to resume the activity. But the method addParentStack needs the class or classname of my last activity. All activities are named 'org.appcelerator.titanium.TiActivity'. How can I adress my custome activity? Is it a Titanium limitation? Cheers!
  2. Sharif AbuDarda 2016-11-10

    Hello, I believe this is how Appcelerator support activity. See http://docs.appcelerator.com/platform/latest/#!/guide/Android_Intent_Filters

JSON Source