android-widget

How to open SMS setting Activity in our application?

ⅰ亾dé卋堺 提交于 2019-12-04 06:16:22
问题 In following code I only able to open compose SMS..... I want to open SMS setting activity without option menu is pressed.. `String SMS_MIME_TYPE = "vnd.android-dir/mms-sms"; Intent defineIntent = new Intent(Intent.ACTION_MAIN); defineIntent.setType(SMS_MIME_TYPE);` 回答1: There is nothing in the Android SDK for this. You are welcome to contact the developers of each of the hundreds of SMS clients, asking them if they have a documented and supported means of launching their settings activity

ListView widget with multiple pending intents

丶灬走出姿态 提交于 2019-12-04 05:59:25
I'm using widget with listview that has 3 types of items. For each type of item I should use different pending intents. Currently I'm using following code: public class MyWidgetProvider extends AppWidgetProvider { @Override public void onUpdate(Context context, AppWidgetManager widgetManager, int[] widgetIds) { for (int widgetId : widgetIds) { RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_view); bindEmptyView(remoteViews); bindRemoteAdapter(context, widgetId, remoteViews); bindIntentTemplate(context, widgetId, remoteViews); widgetManager.updateAppWidget

How to share data between activity and widget?

[亡魂溺海] 提交于 2019-12-04 05:54:53
I read the hellowidget tutorial and Dev Guide' App Widgets. Then I know how to create a widget which contains button or text or something. But what I really want to do is making it interact with my app. For example, I want to create a widget that has a text view, and when I click it, it sends a PendingIntent to my activity in which I can edit the text. I can do the step "sends a PendingIntent". But after I edit text in acitivy, how does the widget read it? What you need to do is register a custom intent, for example ACTION_TEXT_CHANGED in your AppWidgetProvider like this for example: public

How to update an app widget on midnight?

混江龙づ霸主 提交于 2019-12-04 05:38:54
My app has a widget that shows today's date and need to be updated on midnight. The widget is defined in the manifest as <manifest> ... <application> ... <receiver android:name=".MyWidgetProviderClass" android:label="MyLabel" > <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_icon_info" /> </receiver> </application> </manifest> And the widget info file is <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:initialLayout="

Get the intent from onCreate in Android

梦想的初衷 提交于 2019-12-04 04:47:50
I launch an activity from my widget using an Intent with some extra, anyway I can only get the Intent when the activity is in background.. How can I get the Intent when activity is created? Tried with this.getIntent() but extras are null. Thanks in advance How can I get the Intent when activity is created? Call getIntent() on the Activity . Tried with this.getIntent() but extras are null. One possibility is that you are arranging for an existing instance of the activity to return to the foreground (e.g., including FLAG_ACTIVITY_REORDER_TO_FRONT ), in which case you will need to override

ArrayAdapter custom with AutocompleteTextView and onclicklistener

泄露秘密 提交于 2019-12-04 04:21:32
问题 Hy guys! I've coded an AutocompleteTextView and it works good. Now I need to use a listener on drop view of autocomplete. I've implemented a custom ArrayAdapter for my needs, but now when I used my listener I get an execption (IndexOutOfBoundExecption). autoCompleteTextView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> listView, View view, int position, long id) { Intervento intervento = (Intervento) listView.getItemAtPosition(position); Integer

Are Android app widgets (for home screen) allowed gestures?

。_饼干妹妹 提交于 2019-12-04 03:55:53
I noticed that when I swipe my finger from left to right across a home screen widget, in simulator on a AVD, Android switch to the left home screen. I was wondering if its possible to prevent this behavior and allow home screen gadgets to listen and react to finger gestures (like swipe)? Its very critical for my widget UI design. Starting with API level 11 (Android 3.0.x) you can use " android.widget.RemoteViewsService.RemoteViewsFactory " and and assign a widget to use (from docs): ListView : A view that shows items in a vertically scrolling list. For an example, see the Gmail app widget.

Android customize stackview

微笑、不失礼 提交于 2019-12-04 03:41:29
I"m trying to customize the StackView widget to look a little bit different. The stackview default order and view is this : And i"m trying to get to something more like this : Any help will be appreciated Shimi try checking out the source code of StackView . as a first step , you can play with the parameter called "PERSPECTIVE_SHIFT_FACTOR_X" and "PERSPECTIVE_SHIFT_FACTOR_Y" . 来源: https://stackoverflow.com/questions/14029048/android-customize-stackview

Toast size on Galaxy Nexus

点点圈 提交于 2019-12-04 03:31:58
问题 When I use toasts in my app, the size is very very small. But when another app displays a toast, the size is normal (like Advanced Task Killer, or SMS). What do I have to do to get normally-sized toasts? I have a Galaxy Nexus ICS=4.0.1, and my app is using SDK API level 7 (android 2.1+). 回答1: Thank you ! (x1000) Adding <supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/> to my manifest,

Methods to get position of view returns 0

ε祈祈猫儿з 提交于 2019-12-04 03:18:25
This question has been asked several times, but everyone gives the reason for why this occurs (i.e. calculation occurs before the layout is laid). But I need the solution for this. I tried getBottom(); , getTop(); , getLocationOnScreen(int[] location); . But all returns the value Zero (0). I even tried giving these in onStart(); , to give time for layout to be laid, but no luck. Here is my code: TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv = (TextView) findViewById(R.id.textView1); Log.d(