Extract Photos from android device -


i'm using class extract photos , put them in textview

public class mainactivity extends activity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); textview view = new textview(this); cursor cur = getcontentresolver().query(mediastore.images.media.external_content_uri, null, null, null,null); string image= ""; while (cur.movetonext()) {   image+= "from :" + cur.getstring(cur.getcolumnindex(mediastore.audio.media.title));       } view.settext(image); setcontentview(view); } } 

but i'm getting list of errors

03-10 17:14:47.124: e/androidruntime(8872): fatal exception: main 03-10 17:14:47.124: e/androidruntime(8872): java.lang.runtimeexception: unable start                activity componentinfo{com.example.sms/com.example.sms.mainactivity}:     java.lang.nullpointerexception 03-10 17:14:47.124: e/androidruntime(8872):     @     android.app.activitythread.performlaunchactivity(activitythread.java:2313) 03-10 17:14:47.124: e/androidruntime(8872):     @     android.app.activitythread.handlelaunchactivity(activitythread.java:2365) 03-10 17:14:47.124: e/androidruntime(8872):     @     android.app.activitythread.access$600(activitythread.java:156) 03-10 17:14:47.124: e/androidruntime(8872):     @     android.app.activitythread$h.handlemessage(activitythread.java:1344) 03-10 17:14:47.124: e/androidruntime(8872):     @     android.os.handler.dispatchmessage(handler.java:99) 03-10 17:14:47.124: e/androidruntime(8872):     @ android.os.looper.loop(looper.java:153) 03-10 17:14:47.124: e/androidruntime(8872):     @ android.app.activitythread.main(activitythread.java:5336) 03-10 17:14:47.124: e/androidruntime(8872):     @ java.lang.reflect.method.invokenative(native method) 03-10 17:14:47.124: e/androidruntime(8872):     @ java.lang.reflect.method.invoke(method.java:511) 03-10 17:14:47.124: e/androidruntime(8872):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:833) 03-10 17:14:47.124: e/androidruntime(8872):     @     com.android.internal.os.zygoteinit.main(zygoteinit.java:600) 03-10 17:14:47.124: e/androidruntime(8872):     @     dalvik.system.nativestart.main(native method) 03-10 17:14:47.124: e/androidruntime(8872): caused by: java.lang.nullpointerexception 03-10 17:14:47.124: e/androidruntime(8872):     @         com.example.sms.mainactivity.oncreate(mainactivity.java:21)     03-10 17:14:47.124: e/androidruntime(8872):     @     android.app.activity.performcreate(activity.java:5122) 03-10 17:14:47.124: e/androidruntime(8872):     @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1081) 03-10 17:14:47.124: e/androidruntime(8872):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2277) 03-10 17:14:47.124: e/androidruntime(8872):     ... 11 more 


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -