Android-小部件及其应用之间的通信 [英] Android - Communications between a widget and its app

查看:150
本文介绍了Android-小部件及其应用之间的通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小部件,可在下面显示带有文字的各种图像,并在应用程序本身中设置相同的UI.我希望窗口小部件不仅能够打开应用程序,而且能够基于窗口小部件中显示的图片打开应用程序,然后在应用程序中显示相同的图像.但是,我很难把它付诸实践.

I have a widget that shows various images with text below, and the same UI set up in the app itself. I want the widget to not only be able to open the app, but to open the app based on which picture is showing in the widget and then show that same image in the app. However, I am having a tough time getting this to work.

谢谢.

推荐答案

假设ui中有多个图像,您可以为每个图像设置不同的Intent,这些intent分别针对不同的活动.

Let's say there are several images in the ui, you can set different Intent for each image, and these intents each will target a different activity.

此帖子: http://rxwen.blogspot.com/2012/10/communication-between-android-widget.html 可能会给您一些提示.

This post: http://rxwen.blogspot.com/2012/10/communication-between-android-widget.html may give you some hints.

这篇关于Android-小部件及其应用之间的通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆