android-widget

Set lower limit of number of stars shown in RatingBar Android

本秂侑毒 提交于 2019-12-10 17:18:02
问题 With the RatingBar widget in android you can set the number of stars to be show, but is there a way of setting a lower limit on the number of stars that are always active. As an example rating a film or something where you cannot submit a rating of 1? 回答1: If this is not possible in the framework strictyl speaking, you could put a default value of 1 with android:rating set to 1, and the add a listener on the RatingBar to go back to 1 when the user tries to go lower no? 回答2: is there a way of

how to do text wrapping for long text in text view on android

≡放荡痞女 提交于 2019-12-10 16:48:09
问题 In my application,i have text view with long text. i need text wrapping like in the android emulator->contact->phone (screen short of dialpad in contact). but in my application i get text wrapping as follows in the figure: i have tried several ways it does not meet my requirement. i do not need the "..." at right corner of the text view. instead of that, i want to wrap the text as in the first figure(android emulator->contact->phone). how to do that? please help me. Thanks in advance. 回答1: I

Disable input method of EditText but keep cursor blinking

流过昼夜 提交于 2019-12-10 16:36:15
问题 In my Android application, I want an EditText with android:editable="false" but the cursor blinking. The cursor blinking seems doesn't work after "editable" is set to false. I just want to use my own Keyboard widget(not the system's soft keyboard), and keep the cursor blinking. Is there any idea to make that possible? 回答1: Maybe try leaving out the xml attribute android:editable entirely and then try the following in combination to keep the cursor blinking and prevent touch events from

TextView without any default padding [duplicate]

…衆ロ難τιáo~ 提交于 2019-12-10 15:34:00
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: I want textView without any default padding while increasing size of textView I want to remove default padding on TextView. When i increase the size of TextView then its padding size increases automatically. even i set background of text View as "@null". i just want to show only text without any padding. my View looks like this first images and i want to show like second images. This First link shows View is

Can I Update the string message of a ProgressDialog?

有些话、适合烂在心里 提交于 2019-12-10 15:14:59
问题 I set up a progressdialog in an Android AsyncTak and it works. My question is it possible to update in the onProgressUpdate method of the AsyncTask the string that the ProgressDialog displays. I would like to update the string with a publishProgress call to show progress of the task. I can update the string if instead of the progressDialog I have my own textview. The progressDialog looks better and has the spinning wheel. 回答1: Yes you can. Simply call myProgressDialog.setMessage("My New

click listener on android widget Button

坚强是说给别人听的谎言 提交于 2019-12-10 14:58:10
问题 I am new to android development. I want add click listener on button in widget. I am updating widget in service. Thanks in advance. 回答1: Maybe you should look into making a clickable widget. This involves using: remoteView.setOnClickPendingIntent(R.id.widgetFrameLayout, pendingIntent); 来源: https://stackoverflow.com/questions/15609500/click-listener-on-android-widget-button

How to create a transparent Button?

拈花ヽ惹草 提交于 2019-12-10 14:55:32
问题 I am trying to create a transparent Button. In details I set the background's button with an image and I would like to modify the transparency of the button in order to see the background layout's color. 回答1: you can use setAlpha() method to your Button. Using button.setAlpha(0.0) from your java code, will make your button fully transparent. Or you can also use it in your layout xml. Inside your <Button /> tag use the following attribute: android:alpha="0" 回答2: If you use ?android:attr

Create Widget on Application Installation

走远了吗. 提交于 2019-12-10 13:33:07
问题 I was just wondering, is there any way I can make an android widget show up on a user's home screen when they install my application? Also, can I let them choose to create a widget from within my application? 回答1: I was just wondering, is there any way I can make an android widget show up on a user's home screen when they install my application? No, sorry. None of your code gets executed upon install. Also, can I let them choose to create a widget from within my application? No, sorry. Only

Android- Open new activity on listview clicks

让人想犯罪 __ 提交于 2019-12-10 13:09:51
问题 Im trying to make it so that when i click specific items in my listview, it will take me to specific screens. Does anyone know how to do this? Im using the code below for this Furthermore. Im trying to make a single back button appear at the bottom of the listview. So far i can only make it appear on every entry in the listview, help would be greatly appreciated! import android.app.Activity; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import

How to use NumberPicker widget Android 4.0

ε祈祈猫儿з 提交于 2019-12-10 13:00:38
问题 I am trying to configure the NumberPicker widget using API 14 . There are very little tutorials or instructions online that would help me set it up properly. so far I have the following code implemented in main.xml : <NumberPicker android:id="@+id/numberPicker1" android:layout_width="match_parent" android:layout_height="48dp" android:orientation="horizontal" /> and in the main activity in the onCreate() method: NumberPicker np = (NumberPicker) findViewById(R.id.numberPicker1); String[] nums =