android-widget

I Can't use spinner.setAdapter(adapter);

I have CameraList class that provides Cameras list like "SONY","VIVOTEK","VIVOTEK 7XXX","PIXORD","TOSHIBA","JVC E-CON"... And I want to list them in my spinner but i couldnt. there is my codes.. public class AddCam extends MainActivity { CameraList cams = new CameraList(); @Override public void onCreate(Bundle savedInstan...

Highlight edge on Drawable in Android

When i have an ImageButton and a drawable and i want to do something like the Drawer or Twitter where when i press the button and the corner of the image is highlighted over the edge, in drawer its yellow, in twitter its white. Like the one below. How do i set my drawable without using a lot of images? ...

Android tab widget issue

Hi All, I m developing one project. i have 4 tabs. each tab has one list view. i want to display tabs at the bottom of screen. when i click on one tab it will show his list view. m not able to make the layout in XML file. can anyone please help me in this case. becoz its very urgent. Thanks in advance. ...

Android Image view click problem

Hi all, i have one image button and image view. i have set the background of both. but the problem is when i click on image view and image button it is taking me to another activity but it is not showing that button was clicked.(any fade in color of image is not showing). how can i do that? ...

How to maintain the scrolling state while orientation change in android

Hello guys I have created one custom view that contains the horizontalscrollview. Now when i changes the orientation its scroll state change to 0 every time. I got the previous scroll state by using onSaveInstanceState(Bundle savedInstanceState) and onRestoreInstanceState(Bundle savedInstanceState) . in onRestoreInstanceState i am usin...

Overriding OnDraw() for a SlidingDrawer

Hi! I have two questions: What is the function of dispatchDraw()? The documentation says that it draws the children for the widget. Is this called after the onDraw() of the widget or is it totally unrelated. I saw the source code for the SlidingDrawer widget on the Android website. They have not overridden onDraw() for it. I tried ...

How do I programmatically assign an id such as 'android:id/tabcontent''?

I'm looking for the Java equivalent to the XML assignment for assignments such as 'android:id="@android:id/tabcontent"'. thnx ...

what difference have ListActivity between Activity???

I need to change Activity to ListActivity. But I can't start my project... do ı need change manifest.xml for it?? Or how can I change screen from Activity to ListActivity? Is there any difference to startActivity(new Intent(this, list.class)) ? 10-05 17:34:54.722: ERROR/AndroidRuntime(11550): java.lang.RuntimeException: Unable to star...

[Android] How to check the type of a view widget?

How to get that working: if(findViewById(ResIdWithUnkownType) instanceof Bitmap) { Bitmap bitmap = (Bitmap) findViewById(ResIdWithUnkownType); } else if(findViewById(ResIdWithUnkownType) instanceof ImageView) { ImageView = (ImageView) findViewById(ResIdWithUnkownType); } ...

[Android] How to exchange an image in a layer-list by a bitmap?

Here is my Bitmap Bitmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(url).getContent()); //Need some code to access "dynamicItem" and exchange it with my Bitmap And here is my layer list (nothing spectacular). I want to exchange the dynamicItem with my Bitmap. <?xml version="1.0" encoding="utf-8"?> <layer-list ...

EditText alignment, within a LinearLayout that has a 9 Patch background image.

<LinearLayout android:id="@+id/LinearLayout03" android:background="@drawable/ninepatch" android:layout_width="wrap_content" android:layout_height="55dip" android:layout_weight="1"> <LinearLayout android:id="@+id/LinearLayout02" android:layout_width="wrap_content" android:layout_height="wrap_content"> <EditText android:id="@+id/EditText...

Add child views when scrolling in (extened) AdapterView

Hi, I am creating a scrolling panel with many child views (e.g. buttons). Each child view has a fixed location based on their row and column index. I cannot create them at the beginning since there are tons of them and I will run out of memory, so I'd like to only add a child view when it intersects with the screen view port (when users ...

Android Widget Size

Hi,.. Can anyone tell me how to make a flexible AppWidgets in android according to the screen size. I want to make a full screen widget, but when it change screen size, i want to make it flexible. Thanks. ...

How to update widget every minute

Hi, can anyone tell me the best way to update widget every minute. Now i'm using thread inside the AppWidget, but sometimes i get error FAILED BINDER TRANSACTION !!! After that error, i always got a lot of error like that all the time and i can't change the view in my widget again. Thanks ...

Android ListView problem when refreshing

Hi, I've a problem with ListViews. Everytime I try to add an item after it has first been shown, my program FC having following stack frame Thread [<3> main] (Suspended (exception IllegalStateException)) ListView.layoutChildren() line: 1603 AbsListView$CheckForTap.run() line: 1827 ViewRoot(Handler).handleCallback(Message) l...

Dynamically expanding widgets on Android UI

Hi, I'm trying to create a simple Android UI that consists of a EditText and Button widget. However I'm having some problems with setting the layout properties. The UI is supposed to look like this: ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ Left is the EditText and right is the Button. The Button (ImageButton) has a widths of approximately 50x50 whi...

Issue in android list

I have a list view and I am listening using Key listener for KEYCODE_5. The issue I am facing is whenever I press 5, the function onKey() (inside the listener) is called twice. Any idea? ...

Scrollable TextView in Android Widget

Hi, I would like to create an android widget with a scrollable textview. The solutions given to this question http://stackoverflow.com/questions/1748977/making-textview-scrollable-in-android cannot be applied because it is a widget: 1. This findViewById(R.id.textview).setMovementMethod(new MovementMethod()); does not work, since ...

Help needed for creating an Android Activity Layout - Screenshot given

Hello Experts, I need to create a screen(scrollable) exactly similar to the screenshot shown here . I have no idea regarding the kind of layout patterns that I should resort to or the widgets that I should use. The data including thumbnail links, is available dynamically. Experts, kindly help with your valuable suggestions, advices a...

How to listen to a closed activity from a widget? (onActivityResult is only in Activity)

I have a widget that launches an activity, but when the activity finishes using the finish() I don't know how my widget can know about it since I can't override onActivityResult() which seems like the only way to listen when an activity closes... Anyone know of another way to listen for when an Activity closes when it is a widget that ...