【问题标题】:Titanium: New view after intent钛:意图后的新观点
【发布时间】:2015-03-05 13:11:43
【问题描述】:

我正在构建一个 Titanium 应用程序。在这个阶段,我只为 Android 开发这个。

我的应用程序需要执行以下操作:当用户单击按钮时,必须发送通知。我查看了Titanium Notificationmanager 页面,他们帮了我很多忙。当用户单击按钮时,会弹出一个意图。

现在对于我的应用程序的第二部分,我想将用户从通知意图引导到新屏幕(或视图)。怎么可能做到这一点?

在意图中你需要指定类名:

var intent = Ti.Android.createIntent({
    flags : Ti.Android.FLAG_ACTIVITY_CLEAR_TOP | Ti.Android.FLAG_ACTIVITY_NEW_TASK,
    // Substitute the correct classname for your application
    className : 'com.appcelerator.notificationsample.NotificationsampleActivity',
});
intent.addCategory(Ti.Android.CATEGORY_LAUNCHER);

如何将用户引导至新屏幕?我需要制作新的合金控制器吗?我需要建立一个新的观点吗? 有人可以帮帮我吗? :)

【问题讨论】:

    标签: android android-intent titanium notificationmanager


    【解决方案1】:

    您实际上可以使用应用程序的相同(主)包/类并监听newintent 事件(http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Android.Activity-event-newintent),然后呈现特定视图。

    要开始一项新活动,请阅读http://docs.appcelerator.com/titanium/latest/#!/guide/Android_Intents-section-43287298_AndroidIntents-CreateanExplicitIntent

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多