android-widget

get notified when requestSync function completed

 ̄綄美尐妖づ 提交于 2019-12-23 05:27:26
问题 im trying to start the calendar sync programatically using this code Bundle bundle = new Bundle(); bundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true); bundle.putBoolean(ContentResolver.SYNC_EXTRAS_FORCE, true); bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); bundle.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS, true); ContentResolver.requestSync(accounts[0], "com.android.calendar", bundle); i want a way so i can know when sync complete so i can read data from

Android: Help with widget that shows news

半城伤御伤魂 提交于 2019-12-23 05:22:34
问题 I am trying to develop an android widget that should show the latest news, but only one at a time. To see the next post the user could press arrow buttons. I want it to look something like this: What control should I use for this?? 回答1: The controls that you can use in a widget(at least today, may change in future) are limited to: A RemoteViews object (and, consequently, an App Widget) can support the following layout classes: http://developer.android.com/guide/topics/appwidgets/index.html *

Android: Connect buttons with lines

孤者浪人 提交于 2019-12-23 04:54:05
问题 I´m writing an Android Aplication that is very similar to a binary tree/graph, there are several buttons created dinamically but I can´t figure out how to create lines connecting the buttons. Here´s an image showing what I need to do: Here is my XML file: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/vscroll" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" > <HorizontalScrollView xmlns:android="http:

how to make a imageview go in a curve

蹲街弑〆低调 提交于 2019-12-23 04:13:26
问题 i am new in android...i want to make a ferris wheel game and i need to move the ferris wheel chair in the wheel...i use: TranslateAnimation transAnimation1 = new TranslateAnimation(0, 145, 0, 275); transAnimation1.setDuration(6000); ChairA1.startAnimation(transAnimation1); TranslateAnimation transAnimation2 = new TranslateAnimation(0, 50, 0, 50); transAnimation2.setDuration(6000); ChairA2.startAnimation(transAnimation2); TranslateAnimation transAnimation3 = new TranslateAnimation(0, 50, 0, 50

android: history edit text

本小妞迷上赌 提交于 2019-12-23 04:08:13
问题 First summary: class A extends AutoCompleteTextView { public A() { setOnKeyListner( ... new OnKeyLisnter() ... ); //listener 1 } } A obj; obj.setOnKeyListener( ... new OnKeyListner() ... ); //listner 2 Is it possible to have both listeners called ? Right now I get messages only from listener 2. I am trying to build an edit text with history derived from AutoCompleteTextView . The class has an ArrayAdapter that updates itself whenever an enter key is pressed down. So far so good. But when the

How to make spinner like actionbar in native android

筅森魡賤 提交于 2019-12-23 04:05:49
问题 After using Actionbar i thought that what if same widget could be available for native android platform. I dont know if we can grab the styles and apply it to native widgets from actionbar apis(compatibility library v4) or not. What i am asking is spinner widget like below which is mostly used in actionbar. Check for dropdown widget. Is it possible to use the same in native like in Listview ? Many thanks. 回答1: adapter = new ArrayAdapter<CharSequence>(this,android.R.layout.simple_spinner_item,

How can I get all component and widget Id of current Android window screen programmatically?

醉酒当歌 提交于 2019-12-23 03:22:31
问题 I use Robotium Framework for Android testing purpose and manually take component_id or index id or else part of Widgets from Hierarchy Viewer to put value at runtime for testing purpose. Is there any way to take component_id or index id or else part of Widgets Programmatically? So far I'm able to get package name and all activity names under that package application. 回答1: import time, subprocess, socket, re afttFile=open("ApplicationPackage.DOC", "r") fileName="" packageName="" activityName="

How to manage activities in Android?

十年热恋 提交于 2019-12-23 03:15:40
问题 I identified a problem in changing one activity using tab. In one tab activity I'm adding data to my SQLite database, and in the other tab activity I am displaying them using listview(array adapter). But when I come back to add data after adding new items to SQLite, the newly added records are not updated in my listview. How do I fix this? 回答1: You seem to be pulling the list data from a DB. Is there a reason why you are using an ArrayAdapter instead of a CursorAdapter? Anyway, you should

How to manage activities in Android?

女生的网名这么多〃 提交于 2019-12-23 03:15:03
问题 I identified a problem in changing one activity using tab. In one tab activity I'm adding data to my SQLite database, and in the other tab activity I am displaying them using listview(array adapter). But when I come back to add data after adding new items to SQLite, the newly added records are not updated in my listview. How do I fix this? 回答1: You seem to be pulling the list data from a DB. Is there a reason why you are using an ArrayAdapter instead of a CursorAdapter? Anyway, you should

Flashlight widget does not turn off

旧时模样 提交于 2019-12-23 03:01:52
问题 I have created everything necessary for my widget to exist and function. Even so at the first click, t does what it is supposed to but then image gets changed and says problem, and does not function. I want it to open flash and then close it. Help will be much appreciated. FlashlightWidgetProvider public class FlashlightWidgetProvider extends AppWidgetProvider { @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Intent receiver = new