Please suggest a method

Put your problem here if it does not fit any of the other categories.

Please suggest a method

Postby saty_32016 » Thu Mar 27, 2008 12:44 pm

Hi All,

below is code for m3 version API,how can i use it for m5.is there any other method for bold line?

getStringArray method
String[] fileList = extras.getStringArray(BUNDLE_EXTRA_FILELIST);
is now no more available ,is there any other method by which i can use,same approach.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public static final int ACTIVITY_VIEW = 0;
  2.  
  3.                
  4.  
  5.                 public static final String BUNDLE_EXTRA_FILELIST =
  6.  
  7.                         "net.mattiraty.imagebrowser.FileList";
  8.  
  9.                
  10.  
  11.                
  12.  
  13.                 private String TAG = "ThumbnailView";
  14.  
  15.                
  16.  
  17.             private ImageSwitcher mSwitcher;
  18.  
  19.            
  20.  
  21.             private Uri[] mUrls;
  22.  
  23. public void onCreate(Bundle icicle) {
  24.  
  25.                 super.onCreate(icicle);
  26.  
  27.                 requestWindowFeature(Window.FEATURE_NO_TITLE);
  28.  
  29.                
  30.  
  31.                 Bundle extras = getIntent().getExtras();
  32.  
  33.                
  34.  
  35.                 /* Lets get those file paths and
  36.  
  37.                  * convert them into ContentURIs
  38.  
  39.                  */
  40.  
  41.                
  42.  
  43.            String[] fileList = extras.getStringArray(BUNDLE_EXTRA_FILELIST);           
  44.  
  45.                 mUrls = new Uri[fileList.length];
  46.  
  47.                 for(int i=0; i < fileList.length; i++) {
  48.  
  49.                         try {
  50.  
  51.                                 mUrls[i] = new ContentURI(fileList[i]);                        
  52.  
  53.                         }
  54.  
  55.                         catch(URISyntaxException e) {
  56.  
  57.                                 /* Ok, this is not error handling,
  58.  
  59.                                  * it is more like error ignoring.
  60.  
  61.                                  * Do you agree, Simo <img src="http://www.anddev.org/images/smilies/smile.png" alt=":)" title="Smile" />
  62.  
  63.                                  */
  64.  
  65.                                 Log.e(TAG, "Invalid content URI");
  66.  
  67.                         }                      
  68.  
  69.                 }
Parsed in 0.035 seconds, using GeSHi 1.0.8.4
saty_32016
Developer
Developer
 
Posts: 27
Joined: Mon Mar 10, 2008 4:47 am

Top

Postby plusminus » Sat Mar 29, 2008 10:09 pm

Hello saty_32016,

Yes there is another approach, using Parcelable s.

Searching the board should bring the specific topic up :)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests