android-widget

Placing ViewPager as a row in ListView

两盒软妹~` 提交于 2020-01-09 04:26:04
问题 I try to use ViewPager as a row ins ListView but a get a bizarre behaviuor - Only the first row works, but when I scroll the list it disappears. When I scroll an empty row, suddenly the row above is being viewed. It seems like Android creates a single pager and use it for all rows. This is what I see when I launch the app: This is my row layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

storing data in a database using edit text and button

青春壹個敷衍的年華 提交于 2020-01-07 05:10:29
问题 Hi I am trying to insert data into database using EditText and Button I have created. I am stuck at Activity part of the code. I am unable to proceed how to write the Onclick action part for Button and EditText part Please help me. I am new to android DBAdapter.java package com.example.database1; public class DBAdapter { public static final String KEY_ROWID = "_id"; public static final String KEY_ISBN = "isbn"; public static final String KEY_TITLE = "title"; public static final String KEY

ANR due to deadlock between app and widget?

99封情书 提交于 2020-01-07 04:36:27
问题 I have an android app that a) performs an updateData() function (querying content providers and HTTP requests from internet among other things) in a thread, and b) has a home screen widget that performs the same updateData() function every 30mins (not in a thread). a) looks like this: public class MoodMain extends Activity{ public void onCreate(...) { Thread t = new Thread() { public void run() { updateData(this); } }; t.start(); } b) looks like this : public class MoodAppWidgetProvider

How add a webview to a layout that have more widgets

大憨熊 提交于 2020-01-07 04:28:13
问题 I want to add a webview to my layout.But that layout have few other widgets also.But when i run the application webview takes the entire screen and other widgets get disappear.here is my layout page.xml.... <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" > <WebView android:layout_width="match_parent" android:layout_height="200dp"

Detect in android widget a touch event from down to up (or the inverse)

夙愿已清 提交于 2020-01-06 20:25:29
问题 How I can detect a touch event from down to up (or the inverse) in Android widget (sdk 2.3.3)? 回答1: Try setting an OnTouchListener to the widget and getting the event codes with event.getAction(); Suppose your widget is an ImageView. In xml define: <ImageView android:id="@+id/imageview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/image"/> and in Java, your code would be: ImageView mImageView = (ImageView)findViewById

Styling progress dialog in android

白昼怎懂夜的黑 提交于 2020-01-06 12:42:55
问题 Spent half day to understand how to change some styles to progress dialog , but I am not able to do so. Very simple thing I wanted to start with, change the spinner color in progress dialog to some other color other than white ! , Got stuck here itself. In Android SDK , they are using some image and applying animation to it , I will have to do everything from scratch to change the color of the spinner ? Any good examples where progress dialog has been modified would be helpful , I have seen

how to create a web Bookmark with thumbnails android widgets?

别等时光非礼了梦想. 提交于 2020-01-06 08:11:08
问题 Could anybody know how to make web bookmark with thumbnails? please give me an idea on how to get the thumbnails or screen shoots of current bookmark websites.. this is the widget that I would like to learn.. 回答1: This is for ICS+ only : Browser API is being revamped along the lines of Contacts API, now bookmarks are linked to Accounts and also have a folder structure.As far as I know, new Internals have not been exposed via public API calls, and all implementations are likely to be changed

how to create a web Bookmark with thumbnails android widgets?

时光毁灭记忆、已成空白 提交于 2020-01-06 08:10:40
问题 Could anybody know how to make web bookmark with thumbnails? please give me an idea on how to get the thumbnails or screen shoots of current bookmark websites.. this is the widget that I would like to learn.. 回答1: This is for ICS+ only : Browser API is being revamped along the lines of Contacts API, now bookmarks are linked to Accounts and also have a folder structure.As far as I know, new Internals have not been exposed via public API calls, and all implementations are likely to be changed

Changing the checkbox size in Android 2.0

女生的网名这么多〃 提交于 2020-01-05 12:15:21
问题 Ok so I know this has been asked before and there seems to be that all of the answers point to this very old tutorial. http://www.anddev.org/viewtopic.php?p=17050 My problem with that tutorial is it is over a year old and references the use of files that are not available anymore in the android SDK. It is also very hard to understand the crux of what I think should be such a simple thing. Can someone on here please clarify for me. It would seem that you just set a different drawable as the

How to open image url on browser using android widget

 ̄綄美尐妖づ 提交于 2020-01-05 12:12:15
问题 How do i use intent in android widget to open images in browser. 回答1: If the image is on the internet it would be as simple as this: String url = "http://www.picturesnew.com/media/images/image-background.jpg"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); However if the image is inside of your assets you can't open it in the browser. That's because the browser accepts URI data that starts with http . Furthermore the browser is a separate app and one