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
ArrayList<HashMap<String,String>>();
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;

@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<?,?>[songListObj.length];


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

Log.e("Song",i+"completed");
HashMap<String,String> nData=new HashMap<String,String>();
nData.put("nid",nodeid);
Object nodeget=client.call("node.get",nodeid);
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="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("#####"



problem accessing run( ) in android

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


 i!

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....

/Erik

On Apr 22, 12:58pm, Rahul <rahulvarma.kalidindi0...@gmail.com> wrote:
>


Sponsored Links


Other Threads

1. chown problem

Hi, all.

I have one question about the chown() service call.

In the ensure_config_file_exists() function of wifi.c,
this function is called from the "system_server" processor.
The "system_server" process has 1000(system) uid and 1000(system) gid.
As far as I know, to change the ownership of the file, the processor
should have a root permission.
But the "system_server" has no root permission.
So, in my case, the below logs are displayed always.
How can I resolve it?

BR,
nus

[  135.220000] init: event { 'add', '/module/bcm4325', 'module', '',
-1, -1 }
[  135.240000] Linux Kernel SDIO/MMC Driver
[  135.240000] bus: 'sdio': add driver bcmsdh_sdmmc
[  135.240000] sdio_bus_match: return 1
[  135.250000] sdio_bus_probe: sdio_match_device() return 0xbf01ab2c
[  135.260000] sdio_bus_match: return 1
[  135.260000] sdio_bus_probe: sdio_match_device() return 0xbf01ab2c
D/SettingsWifiEnabler(  742): Received wifi state changed from
Disabled to Enabling
[  135.310000] DHD: dongle ram size is set to 393216(orig 393216)
[  135.930000] init: event { 'add', '/devices/virtual/net/eth1',
'net', '', -1, -1 }
[  135.930000] eth1: Broadcom Dongle Host Driver mac=00:22:58:20:80:02
[  136.020000] init: event { 'add', '/bus/sdio/drivers/bcmsdh_sdmmc',
'drivers', '', -1, -1 }
[  136.020000]
[  136.020000] Dongle Host Driver, version 4.218.223.0
D/WifiHW  (  555): ===========(+) wifi_start_supplicant()
D/WifiHW  (  555): ensure_config_file_exists : system_server,
gid=1000, uid=1000
E/WifiHW  (  555): Error changing group ownership of /data/misc/wifi/
bcm_supp.conf to 1010: Operation not permitted
E/WifiHW  (  555): Wi-Fi will not be enabled
D/WifiHW  (  555): ===========wifi_unload_driver()
[  137.310000] init: event { 'remove', '/bus/sdio/drivers/
bcmsdh_sdmmc', 'drivers', '', -1, -1 }
[  137.310000] init: event { 'remove', '/module/bcm4325', 'module',
'', -1, -1 }
E/WifiService(  555): Failed to start supplicant daemon.
D/SettingsWifiEnabler(  742): Received wifi state changed from
Enabling to Unknown


==== ensure_config_file_exists() in the wifi.c ====
    if (chown(SUPP_CONFIG_FILE, AID_SYSTEM, AID_WIFI) < 0) {
        LOGE("Error changing group ownership of %s to %d: %s",
             SUPP_CONFIG_FILE, AID_WIFI, strerror(errno));
        unlink(SUPP_CONFIG_FILE);
        return -1;
    }
====================================

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Rendering artifacts in OpenGL

I am doing some very basic drawing of triangles in OpenGL, but I am
seeing strange rendering errors. When I draw a textured square (two
triangles) part of the square is missing or the texture is stretched
or corrupted. When I draw a square with no texture, part of the square
is missing sometimes.

I do not see a pattern to when it works and when it doesn't. It might
be broken one run, then after a back button and rerun, it works the
next.

The triangle that's missing is not one of the triangles used to draw
the square. Rather it is part of the first triangle and part of the
second triangle. The triangles are the bottom right half and the top
left half of the square, but the part missing is the bottom left half
of the square.

The problem occurs on both the Droid and on the emulator.

--due to Google Groups Error, I can't post any more. I'll try to add
the details in another post--

-- 

3. OpenGL dropping triangles

4. Application installment statistics

5. Populating custom layout from xml resource.

6. Android HAL.

7. Question about BlueZ licenses (LGPL and Apache)