Android 2.2 appWidgetManager.updateAppWidget not work?

by Lit » Wed, 08 Dec 2010 16:27:18 GMT


Sponsored Links
 Hello,

I am working on a widget project.

I use Service to update the widget. Some code shows here:

public static void updateView(RemoteViews views){
        for(int id:appWidgetIds){
                appWidgetManager.updateAppWidget(id, views);
        }
    }

-- 



Other Threads

1. Error inflating class linearlayout

I have one xml file which through error as Error inflating class
linearlayout. Here I want to display one button and below that I want
a list of checkboxes and items (string).
My xml file is

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
   <linearlayout xmlns:android="http://schemas.android.com/apk/res/
android" android:id="@+id/buttonlayout2"
android:orientation="horizontal" android:layout_height="wrap_content"
android:gravity="right" android:layout_width="fill_parent"
android:layout_gravity="right|center_vertical">
                        <button android:id="@+id/btnSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Save"
android:textSize="15sp" android:layout_marginLeft="10px"
android:layout_marginRight="10px" android:layout_marginBottom="2px"
android:layout_marginTop="2px" android:height="15dp"
android:width="70dp"></button>
                        <button android:id="@+id/btnClear"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Clear"
android:textSize="15sp" android:layout_marginLeft="10px"
android:layout_marginRight="10px" android:layout_marginBottom="2px"
android:layout_marginTop="2px" android:height="15dp"
android:width="70dp"></button>
                </linearlayout>


   <CheckBox
                android:id="@+id/switches"
                android:layout_height="wrap_content"
                android:text=""
                android:layout_width="wrap_content">
        </CheckBox>
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <TextView android:id="@+id/room"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="#00ccff"

            />
        </LinearLayout>

    </LinearLayout>
</LinearLayout>

Log cat output is

12-23 11:36:50.858: ERROR/AndroidRuntime(699): Uncaught handler:
thread main exiting due to uncaught exception
12-23 11:36:51.096: ERROR/AndroidRuntime(699):
android.view.InflateException: Binary XML file line #6: Error
inflating class linearlayout
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.LayoutInflater.inflate(LayoutInflater.java:407)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.ResourceCursorAdapter.newView(ResourceCursorAdapter.java:
79)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.SimpleCursorAdapter.newView(SimpleCursorAdapter.java:
96)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.CursorAdapter.getView(CursorAdapter.java:182)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.AbsListView.obtainView(AbsListView.java:1274)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.ListView.makeAndAddView(ListView.java:1668)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.ListView.fillDown(ListView.java:637)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.ListView.fillFromTop(ListView.java:694)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.ListView.layoutChildren(ListView.java:1521)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.AbsListView.onLayout(AbsListView.java:1113)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.View.layout(View.java:6830)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.View.layout(View.java:6830)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.LinearLayout.onLayout(LinearLayout.java:918)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.View.layout(View.java:6830)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.View.layout(View.java:6830)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.ViewRoot.performTraversals(ViewRoot.java:996)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.os.Handler.dispatchMessage(Handler.java:99)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.os.Looper.loop(Looper.java:123)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
java.lang.reflect.Method.invokeNative(Native Method)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
java.lang.reflect.Method.invoke(Method.java:521)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
dalvik.system.NativeStart.main(Native Method)
12-23 11:36:51.096: ERROR/AndroidRuntime(699): Caused by:
java.lang.ClassNotFoundException: android.view.linearlayout in loader
dalvik.system.pathclassloa...@43d0baa0
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
java.lang.ClassLoader.loadClass(ClassLoader.java:573)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
java.lang.ClassLoader.loadClass(ClassLoader.java:532)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.LayoutInflater.createView(LayoutInflater.java:466)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
66)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
12-23 11:36:51.096: ERROR/AndroidRuntime(699):     ... 31 more

what is wrong here? Thanks

-- 

2. Widget

Hi,

I have a widget that launch the configure activity when I click on it.
This widget its a party of my App, and the activity that it launch its
only accessible on the widget click.

So here is the thing, when my App is running and I click the home
button, and them I click on the widget, the configure screen shows up,
but the App itself too, and I dont want it.

If the app is not opened and I click the widget, it works just fine
and only the configuration activity shows up. What am I doing wrong?
Any ideas?

Regards,


-- 

3. How to start a new process on bootup complete

4. supporting only resolutions >= 320x480

5. How to use ndk to compile template classesé”›

6. [WTS] Motorola Defy.

7. [WTS] Moto Milestone 2nd like new