Random appwidget unresponsiveness

by Niall » Fri, 20 May 2011 06:18:28 GMT


Sponsored Links
 Hey,

I have an appwidget that works fine most of the time.  

Sometimes though, the buttons don't respond. When I press on them nothing 
happens. If I swipe to the left and back to the right it seems to sometimes 
fix it. Nothing gets put in logcat so I'm out of ideas about what might be 
happening. 

Can anyone help? Do you need more information? 

It sounds to me that the intents aren't set properly... but they are! I 
can't figure it out. 

-- 



Other Threads

1. Exception using ScrollView in landscape orientation

>From various threads I gather that Android should just use layout-land
automatically, I don't add to the java. I have a minimal layout
main.xml in layout-land  but when I use Numeric-key 9 or start the
application while it is already in landscape it stops unexpectedly and
displays a window ActivityThread.performLaunchActivity(ActivityThread
$ActivityRecord, Intent) line: 2496 saying source not found.

The same xml works fine in a Hello Android project that this one is
based on and I can't see any relevant differences in settings or
AndroidManifest.xml between the two projects. ScrollView does seem to
be the problem as it works fine if I remove it.

Grateful for any ideas on this.

main.xml in layout-land:
<?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/
android"
        android:id="@+id/scrollview"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        >
     <TextView
        android:id="@+id/textview"
                    android:layout_width="fill_parent"
        android:layout_height="fill_parent"
/>
</ScrollView>

.java
public class InvertsUK extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button help = (Button) findViewById(R.id.helpbutt);
        help.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(),
ViewHelp.class);
                startActivityForResult(myIntent, 0);
            }
        });
        ...another similar button
    }
}

Debug:
DalvikVM[localhost:8619]
        Thread [<3> main] (Suspended (exception RuntimeException))
                
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,
Intent) line: 2496

Logcat:
03-01 16:54:12.215: INFO/WindowManager(52): Setting rotation to 1,
animFlags=0
03-01 16:54:12.235: INFO/ActivityManager(52): Config changed:
{ scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/1 nav=3/1 orien=2
layout=18}
03-01 16:54:12.365: INFO/UsageStats(52): Unexpected resume of
com.inverts.uk while already resumed in com.inverts.uk
03-01 16:54:17.355: WARN/WindowManager(52): App freeze timeout
expired.
03-01 16:54:17.365: WARN/WindowManager(52): Force clearing freeze:
AppWindowToken{43e20b70 token=HistoryRecord{43cf8088
com.inverts.uk/.InvertsUK}}
03-01 16:54:19.545: DEBUG/dalvikvm(52): GC freed 2894 objects / 156632
bytes in 164ms


-- 

2. Generic view rollover (selected state)

I'm looking for some advice on how to proceed with implementing a
generic way to make a selected state for many selectable UI items,
without having to have selected state images for each.

I'm working with a large XML driven application where all of the UI's
images are specified in a proprietary XML configuration file.   None
of the UI elements have rollover/selected images.   I'm trying to
avoid having to add rollover images and in turn adding new settings in
XML in order to make these configurable.

My hope is to be able to generically put a tint on existing UI
elements already in the application.  Preferably this could be done in
a factory-like way (pass in a VIew of any kind, and the view gets
tinted).   I can't think of a way, myself, to do this without doing
something like, for each UI element I want to add a "selected" state
tint to, making a relative layout around it or something, where a semi-
transparent image could be overlapped.

Does anyone have some ideas for how I might be able to do this with
the least re-working of my current layouts and code?

Cheers for any suggestions!

-- 

3. Smart Phone Wish List

4. Bundling two apps in the Marketplace

5. Enhancing, Not Replacing, Stock Apps

6. Can I read .pdf From assert folder?

7. MediaPlayer issues in certain devices