I am trying to download a file from url and I have written code for writing to file.
Using java Syntax Highlighting
- Context con = threadSession.getAndroidPlayer().getApplicationContext();
- FileOutputStream fout = con.openFileOutput("aqua.q3z", Context.MODE_PRIVATE);
- fout.write(buffer, 0, length);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
This code gets execute in different thread and when I run this program I get the following error
In catch for writing file Can't create handler inside thread that has not called Looper.prepare()
W/System.err( 417): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
W/System.err( 417): at android.os.Handler.<init>(Handler.java:111)
W/System.err( 417): at android.app.Activity.<init>(Activity.java:660)
W/System.err( 417): at com.qedsoft.player.impl.AndroidPlayer.<init>(AndroidPlayer.java:13)
W/System.err( 417): at com.qedsoft.streamerclient.impl.CStreamingSession.getAndroidPlayer(CStreamingSession.java:261)
W/System.err( 417): at com.qedsoft.streamerclient.impl.SessionDataCollector.getData(CStreamingSession.java:344)
W/System.err( 417): at com.qedsoft.streamerclient.impl.SessionDataCollector.run(CStreamingSession.java:358)
Can anyone suggest me what shall be the problem?
I hope to get the reply as soon as possible.
Thanks & Regards
Sunil

