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/

int readnumber = 0;

        InputStream simStream = null;

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


                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

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


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
For more options, visit this group at

Reply via email to