problem accessing run( ) in android

by Rahul » Thu, 22 Apr 2010 18:59:01 GMT

Sponsored Links
 i i have a problem accessing run() method in my program. The rum
method is not getting focus at all. The Log message that is present
outside the loop is getting displayed and i am getting a blank screen
with preset background.Here's the code...

public class MusicListActivity extends Activity {
List<HashMap<String, String>> songNodeDet = new
HashMap<?,?>[] songNodeWeb;
XMLRPCClient client;
String logInSess;
ArrayList<String> paths=new ArrayList<String>();
public ListAdapter adapter ;
Object[] websongListObject;
List<SongsList> SongsList=new ArrayList<SongsList>();
Runnable r;
ProgressDialog p;
ListView lv;

public void onCreate(Bundle si){

r=new Runnable(){

public void run(){


} catch (MalformedURLException e) {
// TODO Auto-generated catch block
} catch (XMLRPCException e) {
// TODO Auto-generated catch block
Log.e("***","process over");

protected void onResume() {
// TODO Auto-generated method stub


public void webObjectList(Object[] songListObj) throws
songNodeWeb = new HashMap<?,?>[songListObj.length];

for(int i=0;i<songListObj.length;i++){
String nodeid=(String) songNodeWeb[i].get("nid");

HashMap<String,String> nData=new HashMap<String,String>();
HashMap<?,?> songNode=(HashMap<?,?>)nodeget;
String title=(String) songNode.get("title");
String album=(String) songNode.get("album");
String artist=(String) songNode.get("artist");

nData.put("title", title);
nData.put("album", album);
nData.put("artist", artist);

Object[] songObject=(Object[])songNode.get("title_format");
HashMap<?,?>[] songDetails=new HashMap<?,?
songDetails[0]=(HashMap<?, ?>)songObject[0];
String path=(String) songDetails[0].get("filepath");

if(path.contains(" ")){
path=path.replace(" ", "%20");

String songPath=""+path;
nData.put("path", songPath);
Log.e("my path",path);
SongsList songsList=new SongsList(title, album,

Log.e("paths values",paths.toString());

public void list()
{ Log.d("#####"

problem accessing run( ) in android

by krox » Fri, 23 Apr 2010 02:42:16 GMT


Just took a really quick look but AFAICT you try to start the runnable
r from getSongs() but getSongs() is only called from the runnable r,
hence a moment 22. So you probably have to start the runnable r from
onCreate()/onStart() as well (however AFAICT you gonna end up in a
loop calling getSongs() over and over again). But as I said I only
took a really quick look and might have overlooked something....


On Apr 22, 12:58pm, Rahul <> wrote:

Sponsored Links

Other Threads

1. Restarting Camera Preview - Garbled for some resolutions

Howdy Peoples,

When I set the camera picture size to 176x144 or 352x288 the camera
preview gets garbled/discolored "after" (it's fine at first)
onPictureTaken (onPictureTaken calls startPreview after saving the
JPEG in order to restart the preview). This does not happen with any
other resolution I set (e.g. 1280x720 or 1920x1080). The actual
picture taken is fine - just the preview display is messed up.

I've tried everything I could think of -- revalidating the
surfaceholder, removing and re-adding it, resetting the camera picture
size, preview size -- but nothing.

I am stuck. Any suggestions? or Is this an android bug? or is it me?



2. my widgets.setOnTouchListener being called twice

the setOnTouchListener of my widget is being called twice.
am checking it on emulator 1.5 avd.
I commented out the onclicklistener code, and also tried to
setClickable to false and setFocusable to true...but no help

I cant use onclick listener since i have a custom background color an
image so there i no way for user to see where the navigation buttons
are carrying him.

can some one tel me what am i doing wrong here.

3. Restarting Camera Preview - Garbled for some resolutions

4. Saving Cookie to Database

5. Database issue on device

6. Problem with getChildCount method???

7. Setting Focus by code in an array list