imageview issue

+2 Wait Badu · November 16, 2014
Hi, 
i have a imageview that sometimes after a user choose the image sometimes its rotates the picture  to the left so its on its side. I'm wondering if their any forums or link to something that would let the user adjust the image to their satisfaction.

Post a Reply

Replies

- page 1
Oldest  Newest  Rating
0 Developer John · November 21, 2014
It isn't possible to have methods inside other methods since Java only allows new methods to be created outside of the method bodies.
0 Troy Jones · November 21, 2014
I would start with, if you're going to implement your OnClickListener, to use a switch and case inside your onClick method. You have methods inside a method right now, which I didn't believe was possible.
-1 Developer John · November 20, 2014
Oh, ok, sorry, I can't help you with that.
0 Wait Badu · November 20, 2014
yeah android development  ... my onCreate method

public class MainPage extends Activity implements OnClickListener
{

TabHost th;
TextView Catergories, Uotw, Aotw, Ds, Hmos, Eds, Cl;
Button go, Submit;
EditText Name, Email, Phone, Info;

File path;
ImageView iv;
VideoView Vv;
Intent intent = getIntent();
final static int cameraData = 0;
protected static final int SELECT_PHOTO = 1;


@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main_page);
th = (TabHost) findViewById(R.id.tabhost);

Name = (EditText) findViewById(R.id.etNameOfBusiness);
Email = (EditText) findViewById(R.id.etEmail);
Phone = (EditText) findViewById(R.id.etPhone);
Info = (EditText) findViewById(R.id.etAdditionalInfo);

Name.setText("Name");
Email.setText("Email");
Phone.setText("Phone");
Info.setText("Info");

Catergories=(TextView) this.findViewById(R.id.tvCatergorieslv);
Uotw = (TextView) this.findViewById(R.id.tvUserOfTheWeek);

Aotw = (TextView) this.findViewById(R.id.tvArtistOfTheWeek);

Ds = (TextView) this.findViewById(R.id.tvDealSection);
Hmos = (TextView) this.findViewById(R.id.tvHearMeOutSection);
Eds = (TextView) this.findViewById(R.id.tvEncounteredDeals);
Cl = (TextView) this.findViewById(R.id.tvCommentLounge);

iv = (ImageView) findViewById(R.id.imageView);




iv.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
 // TODO Auto-generated method stub
 Intent profilepic = new Intent(
  Intent.ACTION_PICK);
 profilepic.setType("image/*");
  startActivityForResult(profilepic, SELECT_PHOTO);

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { 
        super.onActivityResult(requestCode, resultCode, imageReturnedIntent); 

        switch(requestCode) { 
        case SELECT_PHOTO:
            if(resultCode == RESULT_OK){
 try {
 final Uri imageUri = imageReturnedIntent.getData();
 final InputStream imageStream = getContentResolver().openInputStream(imageUri);
 final Bitmap selectedImage = BitmapFactory.decodeStream(imageStream);
 iv.setImageBitmap(selectedImage);
 } catch (FileNotFoundException e) {
 e.printStackTrace();
 }

            
        }}}

theres more to code in my activity but i didnt add it cause it didnt think its relevant to my question 
0 Troy Jones · November 20, 2014
where's your onCreate method?
-1 Developer John · November 20, 2014
Andriod Development? 
0 Wait Badu · November 20, 2014
oh sorry about that 



iv = (ImageView) findViewById(R.id.imageView);

iv.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
 // TODO Auto-generated method stub
 Intent profilepic = new Intent(
  Intent.ACTION_PICK);
 profilepic.setType("image/*");
  startActivityForResult(profilepic, SELECT_PHOTO);

}

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { 
        super.onActivityResult(requestCode, resultCode, imageReturnedIntent); 

        switch(requestCode) { 
        case SELECT_PHOTO:
            if(resultCode == RESULT_OK){
 try {
 final Uri imageUri = imageReturnedIntent.getData();
 final InputStream imageStream = getContentResolver().openInputStream(imageUri);
 final Bitmap selectedImage = BitmapFactory.decodeStream(imageStream);
 iv.setImageBitmap(selectedImage);
 } catch (FileNotFoundException e) {
 e.printStackTrace();
 }
0 Developer John · November 19, 2014
May I see your code please?:sideways:
0 Wait Badu · November 19, 2014
java 
0 Developer John · November 18, 2014
What language?
  • 1
  • 2

Java / Android Development

107,210 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator