How to set Image to the ImageView dynamically

by murali » Thu, 07 Jan 2010 13:36:17 GMT


Sponsored Links
 hi friends ,
I am facing problem that whenever i am setting the image to a
ImageView dynamically from a file path(not from the Res,drawable),by
using SetImageURI(uri),i am getting one error like
resolve uri failed on bad bitmap uri
so how can i get the image from a file path by using this setImageURI
(uri)
Thanks and Regards
Murali dhuli



Other Threads

1. Using notifications to switch between different already opened activities

Hi all,

 

I am working on an IM application for android. Currently I have one main
activity showing a list of contacts and another activity (let's call it
ChatActivity) for handling conversation.

When the user starts a chat with a contact I open the chat activity with
the startActivity firing an Intent using ACTION_VIEW as action and
CATEGORY_DEFAULT as category with a sessionId as intent data expressed
as a content URI (in my own format content://userId#<IdValue>).

When a second user receives a chat message, a notification is shown in
the status bar. When it clicks on the notification the same intent
described before is fired to start the ChatActivity.

 

ChatActivity is registered in manifest using the following intent
filter:

 

<intent-filter>

                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT"
/>

                <data android:scheme="content"/>

</intent-filter>     

 

When the user clicks on the notification the right activity is started.
But when a new user launches a new message and a second notification is
added to statusbar and the user is not able to open his new chat
activity if the first one is already opened.

Basically, I'm not able to use the notifications on the statusbar to be
able to switch between different already opened conversation activities
(as using alt+tab on windows). It would be great if it was possible to
do so in some way.

 

What's wrong with my approach?

Have you got any suggestion?

 

Please help!

 

Thanks a lot and best regards,

 

Stefano 


--~--~---------~--~----~------------~-------~--~----~

2. Progress bar problem

Hi

I want to show a progress bar and then check if the work that need to
be done is completed yet so I used something like this:

        myProgressDialog = ProgressDialog.show(Test.this,
                          "Please wait...", "Calculating...", true);
                }
          new Thread() {
              public void run() {
                   try{
                         synchronized(lock){
                                //sleep(50);
                                myProgressDialog.dismiss();
                                // Some work here
                         }

                   } catch (Exception e) {  }

              }
         }.start();

The working thread use the lock to make sure the dialog cannot be
dismissed before the work is done. But if the work is done before the
ProgressDialog.show() is executed then it will be there forever. I
guess it's because the dismiss() function is called before the actual
show is called. If I put a sleep before the dismiss then everything is
fine but it's not a good practice and problem may still appear in
slower machine.

So the question is that how can I safely show a progress dialog and
then dismiss it right after it's show (if there is no work)? Is there
anyway I can use a lock to find out when the dialog is shown in the
screen for the dismiss to be executed only after that?

Thank you
--~--~---------~--~----~------------~-------~--~----~

3. Unpleasant interaction between timer and updating a map overlay

4. Extract focus color from theme

5. Is it possible to create file in /system/media directory..

6. m5 not working

7. Slow Bitmap operations