hii i have stuff a lot and find a new way something like below code:
there are three imagebuttons and onclicking each imagebutton a new activity
should be opened.
in the new activity/screen how to open the imagepackage
com.example.Activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;

public class Activit1 extends Activity implements OnClickListener
{

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ImageButton o1 = (ImageButton) findViewById(R.id.btnSequence);
        o1.setOnClickListener(this);

        ImageButton o2 = (ImageButton) findViewById(R.id.btnVideo);
        o2.setOnClickListener(this);

        ImageButton o3 = (ImageButton) findViewById(R.id.btnInfo);
        o3.setOnClickListener(this);

    }

 @Override
 public void onClick(View v)
 {
  switch(v.getId()){
  case R.id.btnSequence:
   // action to preform on button 1
   Intent i1 = new Intent();
            startActivityForResult(i1, 0);
   break;

  case R.id.btnVideo:
   // action to preform on button 1
   Intent i2 = new Intent();
            startActivityForResult(i2, 0);
   break;

  case R.id.btnInfo:
   // action to preform on button 1
   Intent i3 = new Intent();
            startActivityForResult(i3, 0);

   break;
  }

 }
}


On Thu, Oct 28, 2010 at 1:42 AM, Kumar Bibek <[email protected]> wrote:

> If you have the Uri to the media, you can trigger an intent with
> ACTION_VIEW. That should work.
>
> On Oct 27, 1:52 pm, Alok Upadhyay <[email protected]> wrote:
> > hii,
> >
> > can anybody please guide me how to write the code for opening the new
> > image after clicking the imagebutton in android.
> > I have tried something like this:
> >
> > package com.example.imageButton;
> >
> > import android.app.Activity;
> > import android.os.Bundle;
> >
> > import android.view.View;
> > import android.widget.ImageButton;
> >
> > public class imageButton extends Activity {
> >
> >     private static ImageButton seqIBtn;//these are the three
> > imageButton
> >     private static ImageButton vidIBtn;
> >     private static ImageButton infoIBtn;
> >
> >     @Override
> >     public void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.main);
> >
> >         seqIBtn = (ImageButton) findViewById(R.id.btnSequence);
> >         vidIBtn = (ImageButton) findViewById(R.id.btnVideo);
> >         infoIBtn = (ImageButton) findViewById(R.id.btnInfo);
> >
> >     }
> >
> >     seqIBtn.OnClickListener(new ImageButton.OnClickListener() {
> >         public void onClick(View v) {
> >                 //1.how to code to open new image after clicking
> imagebutton
> > seqIBtn
> >                 //2.how to code to open video after clicking
> > imagebutton vidIBtn
> >                 //3.how to code to open another image after clicking
> > imagebutton infoIBtn
> >                   }
> >
> >         }
> >     });
> >
> > }
> >
> > please guide i am very new in android/java .thankss
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Thanks & Regards
Alok Upadhyay
9555758721

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

Reply via email to