Hi there, so I have a problem when trying to set and read an
InputStream from a Uri with path Uri simUri = Uri.parse("content://icc/
sdn");

int readnumber = 0;

        InputStream simStream = null;

//              while (keepread) {                                              
                                                //Keep on reading the signal 
until
the stream ends

                        tv.setText("Reading...");
                setContentView(tv);

                try {
                    simStream =
this.getContentResolver().openInputStream(simUri);      //Opens an
inputstream from the Uri given from the cursor
                } catch(FileNotFoundException e) {
                        simStream = null;
                  }

                try {
                readnumber = simStream.read(ADCsignal);
            } catch (IOException e) {
                readnumber = 0;
              }

I know it is possible that it may not work because it is on a virtual
device, but is there a way to set simStream and readnumber to a value
in case of exception? I thought my code would do it but apparently
not...

Is this the proper way to call an exception by the way?

Thanks!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to