problem accessing run() in android
<p>Hi 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...</p>

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

@Override
public void onCreate(Bundle si){
    super.onCreate(si);

    setContentView(R.layout.openadiuofile);
    lv=(ListView)findViewById(R.id.list1);
    r=new Runnable(){

        public void run(){
            try{

                getSongs();
                list();
                Log.d("handler","handler");  
                removeDialog(0);
                p.dismiss();


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

@Override
protected void onResume() {
    // TODO Auto-generated method stub
      super.onResume();

}

    public void webObjectList(Object[] songListObj) throws XMLRPCException{
    songNodeWeb = new HashMap&lt;?,?&gt;[songListObj.length];


    for(int i=0;i&lt;songListObj.length;i++){ 
        songNodeWeb[i]=(HashMap&lt;?,?&gt;)songListObj[i];
        String nodeid=(String) songNodeWeb[i].get("nid");

        Log.e("Song",i+"completed");
        HashMap&lt;String,String&gt; nData=new HashMap&lt;String,String&gt;();
        nData.put("nid",nodeid);        
        Object nodeget=client.call("node.get",nodeid);
        HashMap&lt;?,?&gt; songNode=(HashMap&lt;?,?&gt;)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&lt;?,?&gt;[] songDetails=new HashMap&lt;?,?&gt;[songObject.length];
        songDetails[0]=(HashMap&lt;?, ?&gt;)songObject[0];
        String path=(String) songDetails[0].get("filepath");


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

        String songPath="http://www.gorinka.com/"+path;
        paths.add(songPath);
        nData.put("path", songPath);
        Log.e("my path",path);
        SongsList songsList=new SongsList(title, album, artist,songPath,songPath);
        SongsList.add(i,songsList);
        songNodeDet.add(i,nData);
    }

    Log.e("paths values",paths.toString());     
    handler.sendEmptyMessage(0);
}

public void list()
  {      Log.d("#####","#####");
     LayoutInflater inflater=getLayoutInflater();
        String[] from={};
        int[] n={};
     adapter=new SongsAdapter(getApplicationContext(),songNodeDet,R.layout.row,from,n,inflater);
     lv.setAdapter(adapter);
  }

public void getSongs() throws MalformedURLException, XMLRPCException
{  
    String ur="http://www.gorinka.com/";
    URL u=new URL(ur);
     client = new XMLRPCClient(u);      
     websongListObject =(Object[]) client.call("nodetype.get","titles");
     webObjectList(websongListObject);
     Log.d("webObjectList","webObjectList");
     runOnUiThread(r);
}
private Handler handler = new Handler() {
    public void handleMessage(Message msg){
       Log.d("handler","handler");        
      removeDialog(0);
      p.dismiss();
     }
</code></pre>

<p>}; 
  }</p>

<p>I m trying to access the strings through simple adapter... Here's the code for adapter...</p>

<pre><code>public class SongsAdapter extends SimpleAdapter{
static List&lt;HashMap&lt;String,String&gt;&gt; songsList;
Context context;
LayoutInflater inflater;
public SongsAdapter(Context context,List&lt;HashMap&lt;String,String&gt;&gt; imgListWeb,int layout,String[] from,int[] to,LayoutInflater inflater) {
    super(context,songsList,layout,from,to);
    this.songsList=songsList;
    this.context=context;
    this.inflater=inflater;
    // TODO Auto-generated constructor stub
}
@Override
public View getView(int postition,View convertView,ViewGroup parent)throws java.lang.OutOfMemoryError{
    try {
    View v = ((LayoutInflater) inflater).inflate(R.layout.row,null);
    ImageView images=(ImageView)v.findViewById(R.id.image);
    TextView tvTitle=(TextView)v.findViewById(R.id.text1);
    TextView tvAlbum=(TextView)v.findViewById(R.id.text2);
    TextView tvArtist=(TextView)v.findViewById(R.id.text3);
    HashMap&lt;String,String&gt; songsHash=songsList.get(postition);
    String path=songsHash.get("path");
    String title=songsHash.get("title");
    String album=songsHash.get("album");
    String artist=songsHash.get("artist");
    String imgPath=path;    
    final ImageView imageView = (ImageView) v.findViewById(R.id.image);
    AsyncImageLoaderv asyncImageLoader=new AsyncImageLoaderv();
    Bitmap cachedImage = asyncImageLoader.loadDrawable(imgPath, new AsyncImageLoaderv.ImageCallback() {
        public void imageLoaded(Bitmap imageDrawable, String imageUrl) {
            imageView.setImageBitmap(imageDrawable);
        }
        });
    imageView.setImageBitmap(cachedImage);
    tvTitle.setText(title);
    tvAlbum.setText(album);
    tvArtist.setText(artist);
    return v;
    }
    catch(Exception e){
        Log.e("error",e.toString());
    }
    return null;
}
public static Bitmap loadImageFromUrl(String url) {
    InputStream inputStream;Bitmap b;
try {
    inputStream = (InputStream) new URL(url).getContent();
    BitmapFactory.Options bpo=  new BitmapFactory.Options();
    bpo.inSampleSize=2;
     b=BitmapFactory.decodeStream(inputStream, null,bpo );
     return b;
} catch (IOException e) {
        throw new RuntimeException(e);
    }
}
</code></pre>

<p>}</p>

<p>Plz help me determinre the problem and solution for my problem... Need it badly...</p>
