android-widget

how to insert jpeg files in edittext android

☆樱花仙子☆ 提交于 2020-01-05 12:12:01
问题 Is there any way to add jpeg files to edittext in android. Basically i am creating a rich text editor in android which should have a provision to display images. Or do i need to make changes in edittext canvas for that. Any suggestions would be really helpful. -Regards, Ron.. 回答1: Maybe you could use the android-richtexteditor component. http://code.google.com/p/android-richtexteditor/ The code has been deleted from the official project but it is still available in the history. http://android

Activity lifecycle within a tabwidget

两盒软妹~` 提交于 2020-01-05 04:29:07
问题 I'm trying to notify my activity when the relevant tab is selected. Consider the follwoing situation: MainActivity: // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, HomeActivity.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("home").setIndicator("Home", res.getDrawable(R.drawable.ic_tab_home)) .setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs intent = new

Performance RemoteViews in Android

半世苍凉 提交于 2020-01-05 04:28:13
问题 I am trying to write a small application in Android. My application is on Widgets. I have a basic doubt on using RemoteViews. I found that whenever , I update some button or some UI layout a new object of the remoteviews is created . Will that be a problem with the performance? an example code is this: http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_message); even for updating the

Android Intent through jar

一世执手 提交于 2020-01-04 16:58:21
问题 I have development one Android Application which has one UI design (like user name,password) i converted my Application into jar(it means i convert my application as library project) after i got the Jar.i used in another application i follow this method 1. I added my jar into Reference library path 2. I include the jar in library path 3. I added my jar in Android manifest file like : <activity android:name=".MainActivity"></activity> (which in jar file) 4. In my src of my second Application i

Is Android Widget ID persistent

て烟熏妆下的殇ゞ 提交于 2020-01-04 04:26:13
问题 Is the widget id that you receive from the OS for a specific instance of your widget on the users desktop consistent until that instance of the Widget is deleted from the desktop? I can't find any documentation that definitive says that it is, but I am assuming that it is because the documentation says you can use the widget id to store any instance configuration information. I want to store some configuration info into a database and tie it to a widget id as the unique reference. So that

How to get string text from AutoCompleteTextView?

最后都变了- 提交于 2020-01-03 08:48:29
问题 public class FareActivity extends Activity { int fareid; String Source; String Dest; AutoCompleteTextView source; AutoCompleteTextView dest; static final String[] SOURCE = new String[] { "Delhi", "Mumbai", "Agra", "Jaipur}; static final String[] DEST = new String[] { "Delhi", "Mumbai", "Agra", "Jaipur}; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fare); dest =

How to read jpg file from a specific location with the cursor

◇◆丶佛笑我妖孽 提交于 2020-01-03 05:28:11
问题 I would like to understand how I can use a cursor to jpg files in a folder specified in the sdcard. I'm trying to select with a cursor the jpg files in a specific folder, and I tried this: This is the code: public static Uri getRandomImage(ContentResolver resolver) { String[] projection = new String[] { BaseColumns._ID, }; String folder = "/sdcard/DCIM/Wallpaper/"; folder = folder + "%"; Uri uri = Media.EXTERNAL_CONTENT_URI; String[] whereArgs = new String[]{folder}; Cursor cursor = resolver

How to detect if a widget is on/off screen?

狂风中的少年 提交于 2020-01-03 03:08:29
问题 I'm writing a customized view similar to Grid which will be used to hold a large amount of images. I'm using ImageButton to display the images, and I only want to load images onto the buttons once they are on the screen (and just display a static background image when they are not). The reason for it is that I'm fetching images from some back-end service and I only want to fetch them when the buttons are on the screen. To do that, I'd like to know if the widget is on the screen. Is it

Widget has a weird bahaviour

橙三吉。 提交于 2020-01-03 02:52:33
问题 I have developed an application that makes use of a widget. The widget could be added in the homescreen and used as a button. I have recently downgraded the version to <uses-sdk android:minSdkVersion="7" /> and no errors were spotted. However, now when i reinstall the, the widget is not responsive. In addition when I try to install the app on another phone running android 4.0.3, widget is not available anywhere, so i cannot even add it to the homescreen. Here is my code for the widget: public