android-widget

Android Tabhost Problem - .setIndicator

十年热恋 提交于 2019-12-06 05:56:01
问题 First let me clarify that i have already referred the SO question related to "Android - TAbhost". I have done googling about "Android Tabhost" but failed to find the solution. My problem is: If are having <3 tabs then it is fine. but Supporse if we are having 4 tabs with indicator title as TabHost1, TabHost2, TabHost3, TabHost4). But this title in Tab does not get fitted with tab. so is there any way to fit the Title Text (i.e. indicator) inside the tab ?? 回答1: I thought the source of our

How to add a dynamically created LinearLayout to a ScrollView?

不打扰是莪最后的温柔 提交于 2019-12-06 05:46:52
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(LinearLayout) is undefined for the type ScrollView" So what should I do to add the LinearLayout to the

How to set the value of the datePicker in to EditText?

一个人想着一个人 提交于 2019-12-06 05:36:41
My XMl Layout is as like below: <RelativeLayout android:id="@+id/dateSelectionLayout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:visibility="visible"> <EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:singleLine="true" android:id="@+id/dateSelectionEditText" android:gravity="center" android:textColor="#000000" android:textSize="14sp" android:cursorVisible="false" android:focusable="false" android:hint="tax code" android:layout_weight="1"/> <DatePicker android:id="@+id/datePicker" android

R.id Cannot be resolved

爷,独闯天下 提交于 2019-12-06 04:54:44
问题 I guess something should be done with the Android-Manifest.xml file or something in the layout folder. I am new to Android so I don't know what I should write. public class AndroidPong extends Activity implements OnClickListener { static String tag; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super .onCreate(savedInstanceState); tag = getResources().getString(R.string.app_name); fullScreen(); splashScreen(); } @Override protected Dialog

onListItemClick method not called when I use Checkox in list

痞子三分冷 提交于 2019-12-06 04:53:49
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 links like How to fire onListItemClick in Listactivity with buttons in list? Android ListActivity

Android: Clickable TextView with Linkified links

試著忘記壹切 提交于 2019-12-06 04:38:45
I have a TextView in my layout which has an attribute "clickable=true" set in XML. This is to allow it behave like a button with both text and icon. Now, I add to that TextView HTML text via call HTML.fromHtml(), and apply Linkify.addLinks after that. The problem is: in such configuration, links are not clickable. Is there any suggestion, how to allow user click on links, other from creating custom TextView-based class? Thanks try add an attribute "android:autoLink="web"" to the textview Also, I have struggled hours against the TextView before realizing that <resources> <string name="mytext"

How to show a message when the phone is unlocked

空扰寡人 提交于 2019-12-06 04:29:16
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. 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.intent.action.SCREEN_ON" /> <action android:name="android.intent.action.USER_PRESENT" /> </intent-filter> <

Button click lost on widget when screen is rotated

瘦欲@ 提交于 2019-12-06 04:01:18
问题 I have a very simple widget application which consists of a LinearLayout with a background and an ImageButton . In the AppWidgetProvider onUpdate() method, I register the click of the button to broadcast an intent. When the widget first loads, everything runs fine and the click is captured. The problem occurs when the screen is rotated, and the click is never captured again even if the screen is rotated back. What do I have to do to re-register the click when the screen rotates? below is some

Why should I use RemoteViews for Android home screen widgets?

ⅰ亾dé卋堺 提交于 2019-12-06 03:55:42
I'm trying to realize an Android home screen widget. I am interested to know why I should use RemoteViews in implementing widgets? Refer this link site . Creating the App Widget layout is simple if you're familiar with Declaring Layout in XML. However, you must be aware that App Widget layouts are based on RemoteViews, which do not support every kind of layout or view widget. A RemoteViews object (and, consequently, an App Widget) can support the following layout classes: FrameLayout LinearLayout RelativeLayout And the following widget classes: AnalogClock Button Chronometer ImageButton

Android Updating ListView

大兔子大兔子 提交于 2019-12-06 03:17:37
问题 I have looked at Android - how to update ListView item that is currently displayed and http://commonsware.com/Android/excerpt.pdf and the Android documentation but I still don't understand. My problem: Using a handler, I am trying to update a Stock data multi-column listview which I have populated from a webservice which retrieves data from a MySQL database. To update the listview, I am calling a servlet which returns an XML that I loop through using DOM. I cannot find a working way to apply