Android Wear: Creating Lists trouble -
i new android , new android wear development. ultimately, goal dynamically create list of 10 items. each item have image , textview. trying implement example given here: https://developer.android.com/training/wearables/ui/lists.html . things have changed in example in res/layout/list_item.xml file: imageview has no src. instead, set background color hash value. change textview.textcolor hash value.
everything compiles fine , able install app onto moto 360, via bluetooth. however, when open app on moto 360, error message appears "unfortunately, myapp has stopped." know if comment out line:
listview.setadapter(new adapter(this, elements));
in wearactivity.oncreate method, error not appear, content of app blank. great! thank you.
edit: logcat
i/activitymanager( 1785): resuming delayed broadcast i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast --------- beginning of main v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.google.android.gms/.wearable.init.initializegmswearablereceiver i/activitymanager( 1785): resuming delayed broadcast d/gcm ( 1994): gcmservice start intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.gcmservice } com.google.android .gms.initialize d/authorizationbluetoothservice( 1994): received gmscore event: intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.auth.be .proximity.authorization.bt.authorizationbluetoothservice$autostarter }. v/gmscorestatsservicelauncher(29720): received broadcast intent intent { act=com.google.android.gms.initialize flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.common. stats.gmscorestatsservicelauncher } i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast e/libsuspend( 1785): error writing /sys/power/state: device or resource busy i/activitymanager( 1785): delay finish: com.google.android.gms/.checkin.eventlogservice$receiver i/eventlogservice(29720): aggregate 1437604524915 (log), 1437604524915 (data) i/activitymanager( 1785): resuming delayed broadcast i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires e/libsuspend( 1785): error writing /sys/power/state: device or resource busy i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast e/streamvibrator( 1911): found notifications tried vibrate, never made top of stream. not vibrating. i/activitymanager( 1785): delay finish: com.google.android.gms/.checkin.eventlogservice$receiver i/eventlogservice(29720): aggregate 1437606510039 (log), 1437606510039 (data) i/googleurlconnfactory( 1994): using platform sslcertificatesocketfactory i/googleurlconnfactory( 1994): using platform sslcertificatesocketfactory w/uploader( 1994): no account auth token provided i/art (29720): waitforgctocomplete blocked 17.730ms cause disablemovinggc i/activitymanager( 1785): resuming delayed broadcast i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast d/clockworkproxy( 1911): doaccept: create socket stream 5 tcp connection /192.168.167.239:54729 /74.125.25.95:443 d/clockworkproxy( 1911): doaccept: rpc succeeded. activate stream 5 w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires e/libsuspend( 1785): error writing /sys/power/state: device or resource busy e/streamvibrator( 1911): found notifications tried vibrate, never made top of stream. not vibrating. w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires e/libsuspend( 1785): error writing /sys/power/state: device or resource busy e/libsuspend( 1785): error writing /sys/power/state: device or resource busy i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast d/sensorhal( 1785): adjustsensorhandle: handle = 10 adjustedhandle = 1 i/activitymanager( 1785): delay finish: com.google.android.gms/.checkin.eventlogservice$receiver i/eventlogservice(29720): aggregate 1437608311873 (log), 1437608311873 (data) i/activitymanager( 1785): resuming delayed broadcast i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast i/art ( 1785): explicit concurrent mark sweep gc freed 31045(2046kb) allocspace objects, 5(80kb) los objects, 19% free, 7mb/9mb, paused 1.708ms total 103.118ms w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires e/libsuspend( 1785): error writing /sys/power/state: device or resource busy e/streamvibrator( 1911): found notifications tried vibrate, never made top of stream. not vibrating. e/libsuspend( 1785): error writing /sys/power/state: device or resource busy i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast i/activitymanager( 1785): delay finish: com.google.android.gms/.checkin.eventlogservice$receiver i/eventlogservice(29720): aggregate 1437610113756 (log), 1437610113756 (data) i/googleurlconnfactory( 1994): using platform sslcertificatesocketfactory i/activitymanager( 1785): resuming delayed broadcast i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires e/libsuspend( 1785): error writing /sys/power/state: device or resource busy i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast d/sensorhal( 1785): adjustsensorhandle: handle = 10 adjustedhandle = 1 e/streamvibrator( 1911): found notifications tried vibrate, never made top of stream. not vibrating. i/activitymanager( 1785): delay finish: com.motorola.targetnotif/com.motorola.omni.notificationalarmreceiver i/activitymanager( 1785): resuming delayed broadcast w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires e/streamvibrator( 1911): found notifications tried vibrate, never made top of stream. not vibrating. w/bt-btif ( 2231): dm_pm_timer expires w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires e/libsuspend( 1785): error writing /sys/power/state: device or resource busy i/activitymanager( 1785): delay finish: com.google.android.gms/.checkin.eventlogservice$receiver i/eventlogservice(29720): aggregate 1437611998899 (log), 1437611998899 (data) i/activitymanager( 1785): resuming delayed broadcast w/bt-btif ( 2231): dm_pm_timer expires 0 w/bt-btif ( 2231): proc dm_pm_timer expires
as requested, here coded solution:
<!--<?xml version="1.0" encoding="utf-8"?>--> <com.my.app.wearablelistitemlayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center_vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:layout_gravity="center_vertical" android:gravity="center_vertical"> <imageview android:id="@+id/id1" android:layout_height="70dp" android:layout_margin="2dp" android:layout_width="70dp" android:adjustviewbounds="true"/> <textview android:id="@+id/id2" android:gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontfamily="sans-serif-condensed-light" android:textcolor="#000003" android:textsize="12sp" android:layout_gravity="center_vertical"/> <!--android:drawabletop="@drawable/myimage"/>--> <!--android:drawablepadding="2dp"/>--> </linearlayout> </com.my.app.wearablelistitemlayout>
Comments
Post a Comment