android-widget

How to make widget of running application in android?

谁说胖子不能爱 提交于 2019-12-10 12:55:02
问题 I want to make my running application's widget. I mean I want to access my application through widget on home screen. I want to dial a call, send sms to particular number which is stored in my application. Is it possible in android? I am stuck on this if anyone has any type of idea then please suggest me.. Edit :- I want to make widget like Power Control. In this we can operate all features of settings through widget. At the same ways I want to control my application through widget and for

How do I place the text inside an EditText widget at the top?

江枫思渺然 提交于 2019-12-10 12:49:04
问题 I have the following xml for an edittext and button which take the whole screen. The only problem is I can't find a way to make the typed text in the edittext to be put at the top. Right now it's put in the centre of the editText. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="@drawable/herinnering_background" android:layout_width="fill_parent" android:layout_height="fill_parent

DatePickerDialog with theme Holo Light?

巧了我就是萌 提交于 2019-12-10 12:45:59
问题 How is it possible to get a DatePickerDialog with Holo Light theme? When creating a DatePickerDialog as follows: DatePickerDialog dpd = new DatePickerDialog(new ContextThemeWrapper(this, android.R.style.Theme_Holo_Light_Dialog_NoActionBar), new DateListener(v), mTime.year, mTime.month, mTime.monthDay); or with theme android.R.style.Theme_Holo_Light or android.R.style.Theme_Holo_Light_Dialog , I get a date picker with a standard title and standard buttons. I tried to use a custom theme with a

How do I get the android icons to change state (highlights)?

╄→гoц情女王★ 提交于 2019-12-10 12:12:01
问题 I am using the Android SDK icon-button for refresh (ic_menu_refresh) in a widget and I need to change the selection state when it is pressed. How is this done? Do I define an XML for the button? 回答1: You define the different states in xml via selector. Sample (esp. see the state-attributes): <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/bg_catlocfilter" android:state_pressed="false" /> <item

Who (and how) create an instance of AppWidgetProvider?

筅森魡賤 提交于 2019-12-10 12:08:53
问题 upd2. The problem has gone after a sort of black magic routine (uninstall, clean Eclipse project, reboot Android device, rebuild, install, run). It is not solved, it has gone. Could anyone please explain what has happened? upd. Seems, no Java code running at all in my Android widget project modeled after Hello Widget tutorial (ref. comments). Is there any way to run some code to make my widget useful? I believe it is possible because there are a lot of do-something widgets. How they make it?

Android: Start activity from app widget with ListView and Service

浪尽此生 提交于 2019-12-10 11:54:56
问题 I am using a ListView in a App Widget to show some items from a RSS feed. I want to go to a activity of my app if I click on a item in the ListView. I am at the point that I can show a Toast with the clicked position. I want to go to. But I do not know how to start the activity. I need to put my RSSFeed and the position inside the intent which starts the activity. I have a WidgetProvider.java which calls a RemoteFetchService.java in the onUpdate() method. In the OnStartCommand() of this

How to create a service in Android that can't be killed by Advanced Task Killer

家住魔仙堡 提交于 2019-12-10 11:36:48
问题 I create a security application just like Mcafee wave secure. My application is listening for SMS command and doing some action when the command is match, so I create a form with another service for listening the SMS. Here's the main form: public static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"; ArrayList<String> messageList; ArrayAdapter< String> adapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //untuk

How to add a dynamically created LinearLayout to a ScrollView?

孤街浪徒 提交于 2019-12-10 11:15:50
问题 I want to dynamically add some widgets like so: LinearLayout llay = new LinearLayout(this); llay.setOrientation(LinearLayout.HORIZONTAL); LinearLayout.LayoutParams llp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); llp.weight = 1.0f; CheckBox cb = new CheckBox(getApplicationContext()); cb.setText("1"); cb.setLayoutParams(llp); llay.addView(cb); ScrollView svh = (ScrollView) findViewById(R.id.scrollViewHost); svh.AddView(llay); ...but I'm getting, "The method AddView

How to show a message when the phone is unlocked

拈花ヽ惹草 提交于 2019-12-10 10:59:44
问题 I want to make an application that would display a message when a user unlocks his/her Android phone. I do not know if this is possible or not. If anyone has a way to do this, could you please point me in the right direction. 回答1: Yes you can do this In your manifest file write this, receiver android:name=".MyBroadCastReceiver" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <category android:name="android.intent.category.HOME" /> <action android:name="android

onListItemClick method not called when I use Checkox in list

怎甘沉沦 提交于 2019-12-10 10:53:56
问题 Hi guys I am new to android...I want to display a dynamic list of CheckBox and on Clicking multiple of those CheckBoxes i want their data in a single string...But my problem is that i am unable to call onListItemClick method if I use checkBox in my List... It is my understanding and experience however that putting a focusable view in the list item prevents the firing of onListItemClick() in the ListActivity when the list item is clicked. But can anyone Plz give me solution... I have referred