Activities and ListActivities with button and lists

by ~ TreKing » Fri, 23 Apr 2010 10:37:21 GMT


Sponsored Links
 



Cool, me too! Well, mostly buses, but same diff.



Sure you can.



No, you don't HAVE to, but extending ListActivity does simplify things if
your activity is predominantly list-oriented.



Crashes HOW? We can't read your mind (or code).

 By the way, if I put
"public class NextTrain extends Activity {"

Did you actually add a ListView to the Activity?



I can try.
If you extend ListActivity you can add a header view to your ListView
containing your two buttons.
Alternatively if you extend Activity, you can create a layout with your two
buttons and a ListView.



You're welcome in advance.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
 http://sites.google.com/site/rezmobileapps/treking 

--



Other Threads

1. MonkeyImage.writeToFile error

I am running this as ./monkeyrunner test.py

 17 # Takes a screenshot
 18 result = device.takeSnapshot
 19
 20 # Writes the screenshot to a file
 21 result.writeToFile('shot1.png','png')

This throws an error as.. any thoughts ...

mini@tools$./monkeyrunner test.py
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
Script terminated due to an exception
110130 03:47:34.316:S [main]
[com.android.monkeyrunner.MonkeyRunnerOptions]Traceback (most recent call
last):
  File "/Users/dan/Android/android-sdk-mac_x86/tools/test.py", line 21, in
<module>
    result.writeToFile('shot1.png','png')
AttributeError: 'instancemethod' object has no attribute 'writeToFile'

110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.PyException.fillInStackTrace(PyException.java:70)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
java.lang.Throwable.<init>(Throwable.java:181)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
java.lang.Exception.<init>(Exception.java:29)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
java.lang.RuntimeException.<init>(RuntimeException.java:32)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.PyException.<init>(PyException.java:46)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.PyException.<init>(PyException.java:43)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.PyException.<init>(PyException.java:61)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.Py.AttributeError(Py.java:145)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.PyObject.noAttributeError(PyObject.java:936)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.PyObject.__getattr__(PyObject.java:931)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.pycode._pyx0.f$0(/Users/dan/Android/android-sdk-mac_x86/tools/test.py:21)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.pycode._pyx0.call_function(/Users/dan/Android/android-sdk-mac_x86/tools/test.py)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.PyTableCode.call(PyTableCode.java:165)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.PyCode.call(PyCode.java:18)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.Py.runCode(Py.java:1197)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.core.__builtin__.execfile_flags(__builtin__.java:538)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:156)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
com.android.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:92)
110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:203)
mini@tools$


-Dan

-- 

2. Honeycomb Preview is back

FYI, am downloading the Honeycomb preview now via the SDK & AVD
Manager. Did not work an hour ago, now it does. Do not know what
happened since it disappeared last Friday. No word from Google.
Anyway it is back again.

-- 

3. Service.startForeground() -- what is the "int id" parameter?

4. TextView - how to make appended text visible?

5. HoneyComb and LayoutInflator-cloning seems broken

6. HC SDK Preview for Linux is back

7. Failed to get froyo