Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 按通知后显示弹出窗口_Android_Android Activity_Android Notifications - Fatal编程技术网

Android 按通知后显示弹出窗口

Android 按通知后显示弹出窗口,android,android-activity,android-notifications,Android,Android Activity,Android Notifications,我制作了这个应用程序,它会在一定时间内通知用户。通知只显示一个字符串,一个大句子。(通知就像屏幕左上角显示的所有消息一样) 因此,当我单击notif时,有些字符串太长,无法读取。它会重新打开应用程序。我想要的是,在弹出窗口中显示字符串。我认为这比再次打开应用程序要好 那么,我如何才能做到这一点,或任何其他解决方案?字符串从左向右移动,这样用户就可以阅读,就像广播符号一样 谢谢 这是我的舱单 <application android:allowBackup="true" an

我制作了这个应用程序,它会在一定时间内通知用户。通知只显示一个字符串,一个大句子。(通知就像屏幕左上角显示的所有消息一样)

因此,当我单击notif时,有些字符串太长,无法读取。它会重新打开应用程序。我想要的是,在弹出窗口中显示字符串。我认为这比再次打开应用程序要好

那么,我如何才能做到这一点,或任何其他解决方案?字符串从左向右移动,这样用户就可以阅读,就像广播符号一样

谢谢

这是我的舱单

<application
    android:allowBackup="true"
    android:hardwareAccelerated="true"
    android:icon="@drawable/elma"
    android:label="@string/app_name"
    android:theme="@style/Theme.Light.NoTitleBar" >
    <service android:name=".Service_class" />

    <activity
        android:name="com.package.Acilis"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.package.Class1"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.package.Class2"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.package.Class3"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
    </activity>
</application>

将活动装扮成对话怎么样



要查看示例,请访问android清单。您可以自定义它,使其看起来像您想要的任何弹出窗口。

如果您不想将活动装扮成对话框,您可以访问developer.android.com上的并查看扩展的布局。
我想这对你的情况会更好。

这没用。我想我需要一个特定的通知类?我将此应用于mainactivity,它与所有应用程序进行对话。它只会将特定活动转换为对话主题。也许可以尝试创建一个带有对话框主题的新活动,然后让通知打开该活动而不是主活动。
<activity android:theme="@android:style/Theme.Dialog" />