android - 钛: Intent 后的新观点

标签 android android-intent titanium notificationmanager

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

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

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

在 Intent 中你需要指定类名:

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);

如何将用户引导至新屏幕?我需要做一个新的合金 Controller 吗?我需要做一个新的观点吗? 有人可以帮帮我吗? :)

最佳答案

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

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

关于android - 钛: Intent 后的新观点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28878667/

相关文章:

Android:在我的应用程序中播放 youtube 视频

java - Android模拟运行dexer失败(Win 7)

android - 计时器任务在 android 中无限期后停止运行

android - 如何检索存储在 sqlite 中的日期并将其转换为 timeStamp 以便能够将其与当前日期进行比较?

android - 没有附加功能的通知 throw Intent

android - 如何使用钛以编程方式获取 Android/iPhone 的联系人列表

ios - Titanium - 无法为设备构建(com.apple.syslog_relay 错误)

java - 如何在 fragment 中声明适配器?

android - 如何更改 Material 抽屉中所选项目的图标颜色?

android - 通过 Intent 拒绝文件提供者的权限