Problem in showing multiple images in ImageView object

by Md.Fazla Rabbi OPU » Fri, 20 May 2011 09:50:38 GMT


Sponsored Links
 Hi,

I am new in Android. I made a small project with two button ("next"
and "previous") and a ImageView object. In the res/drawable folder i
have some images. I store this images in an Array object. Now i want
to show the images which is come from the Array object one by one when
the next button is pressed. Same event will be occured when the
previous button is clicked. How can i do this.

Plz anyone help me.

Thanks in Advance

Md.Fazla Rabbi Opu

-- 



Re: Problem in showing multiple images in ImageView object

by Saurav » Fri, 20 May 2011 12:28:21 GMT


 Use a Gallery, or an ImageSwitcher.




Regards,
Saurav Mukherjee.


On Thu, May 19, 2011 at 10:37 AM, Md.Fazla Rabbi OPU <




-- 


Sponsored Links


Other Threads

1. Hi, all, how to implement the layout as google reader's news ListItem

Please have a look at the photo in this link below:
http://www.wareground.com/articles/android_google_reader_app_updated_with_new_widgets_and_ui_tweaks

My question is: the ListItem's view shows news title and its source
together. But the title and source have different font style, how to
get this?

Help, thanks!

-- 

2. problem when passing value between activities !

Hi...

I have a problem when i'm passing value between activities....i'm using a
activity to get information from a database and put into a listview after
this I'm using a  onListItemClick
to call the another activity  to show the  a details of the item I
selected...but when I put the key value of my item Id  on Intent method
"putExtra" I cant get then into another acitivity...
what I'm doing wrong ?!
Thanks Igor

here my code:
first activity  class (Restaurant.java)

public class Restaurants extends ListActivity {         
        
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                try {
                         setContentView(R.layout.restaurants);          
                         ListRestaurants();
                } catch (Exception e) {
                        // TODO: handle exception
                        Log.e("oncreate resta",e.getMessage());
                }
                
                
        } 
        @Override
        protected void onListItemClick(ListView l, View v, int position,
long id) { 
                // TODO Auto-generated method stub 
                //super.onListItemClick(l, v, position, id);
                
                String[] FROM = {"_id","res_name", "res_city"};

                Intent its = new
Intent().setClass(getBaseContext(),RestaurantsDetails.class);   
                DBAdapter dbAdapter = DBAdapter.getDBAdapterInstance(this);
                 try {
                                dbAdapter.createDataBase();
                                
                        } catch (IOException e) {
                                // TODO: handle exception
                                Log.e("*** select ",e.getMessage());
                        }
                dbAdapter.openDataBase();                                
                Cursor c = dbAdapter.selectRecordsFromDB("restaurants",
FROM,null,null,null,null,null);
                c.moveToPosition(position);             
                its.putExtra("Key",id);         
                startActivity(its);
                
        }       

        public void ListRestaurants(){                   
                         DBAdapter dbAdapter =
DBAdapter.getDBAdapterInstance(this);
                         String[] FROM = {"_id","res_name", "res_city"};
                         int[] TO = {R.id._id,R.id.res_name,R.id.res_city};
                         try {
                                        dbAdapter.createDataBase();
                                        
                                } catch (IOException e) {
                                        // TODO: handle exception
                                        Log.e("*** select ",e.getMessage());
                                }
                                 dbAdapter.openDataBase();

                                 Cursor c =
dbAdapter.selectRecordsFromDB("restaurants", FROM,null,null,null,null,null);

                                 SimpleCursorAdapter sAdapter = new
SimpleCursorAdapter(this,R.layout.restaurant_row,c,FROM,TO);
                                 setListAdapter(sAdapter);
                                 dbAdapter.close();
        }
}
   
//Second Activity 

public class RestaurantsDetails extends Activity {
        
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                try {
                         setContentView(R.layout.restaurants_details);

                         Bundle extra = getIntent().getExtras();

                         if (extra != null) {
                                 String mRowId = extra.getString("Key");
                                 if (mRowId != null) {
                                        TextView txtResId =
(TextView)findViewById(R.id.txtResId);
                                        txtResId.setText(mRowId);
                                }
                        }
                         
                } catch (Exception e) {
                        // TODO: handle exception
                        Log.e("oncreate resta",e.getMessage());
                }
                
                
        } 
}


-- 

3. Compiler can't find method of ImageView.setBaselineAlignBottom(boolean);

4. Can't disable touch events for wallpaper engine

5. How should I design questionnaire on android?

6. Jar with resources like android.jar

7. on orientation change, keep all objects, just change content view