[android-developers] Re: Out of three buttons, one button is not working
I removed this still not working On May 11, 5:44 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: On 11 May 2011 14:28, mack2978 smashmah...@gmail.com wrote: android:onClick=selfDestruct Regards, Marcin Orlowski *Tray Agenda http://bit.ly/trayagenda* - keep you daily schedule handy... *Date In Tray* http://bit.ly/dateintraypro - current date at glance... WebnetMobile on *Facebook http://webnetmobile.com/fb/* and *Twitterhttp://webnetmobile.com/twitter/ * -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Out of three buttons, one button is not working
Is Button selector switches if you push the Button? On 11 Тра, 15:28, mack2978 smashmah...@gmail.com wrote: Hi All, I am baffling with below issue. Out of three buttons, save button is not working and its onclick is not hitting. Any idea anyone. below code and XML i am using. setContentView(R.layout.myimageview); mImageView = (ImageView) findViewById(R.id.imageview); mImageView.setDrawingCacheEnabled(true); mImageView.setImageResource(param1); mslideshow = (ImageButton)findViewById(R.id.slideshow); mSave = (ImageButton)findViewById(R.id.msave); mslideshow.setOnClickListener(new OnClickListener() { public void onClick(View view) { Intent MyIntent = new Intent(myimageview.this, slideshowview.class); startActivity(MyIntent); } }); mSave.setOnClickListener(new OnClickListener() { public void onClick(View view) { saveWallpaperToSD(saveFile+.png); updateExternalStorageState(); } }); msetwallpaper = (ImageButton) findViewById(R.id.setwallpaper); msetwallpaper.setOnClickListener(new OnClickListener() { public void onClick(View view) { wallpaperManager.setWallpaperOffsetSteps(0.5f, 0.5f); wallpaperManager.setWallpaperOffsets(view.getRootView().getWindowToken(), 0.5f, 0.5f); //wallpaperManager.suggestDesiredDimensions(320, 480); try { wallpaperManager.setBitmap(mImageView.getDrawingCache()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finish(); } }); XML: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/inner_bg ImageView android:layout_width=fill_parent android:layout_height=435dp android:id=@+id/imageview android:adjustViewBounds=true android:gravity=center/ ImageButton android:id=@+id/setwallpaper style=@android:style/Widget.Button.Inset android:src=@drawable/btn_setwallpaper android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/imageview / ImageButton android:id=@+id/msave style=@android:style/Widget.Button.Inset android:src=@drawable/btn_save android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/slideshow android:layout_alignRight=@+id/setwallpaper android:onClick=selfDestruct / ImageButton android:id=@+id/slideshow style=@android:style/Widget.Button.Inset android:src=@drawable/btn_slideshow android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignRight=@+id/imageview / /RelativeLayout thanks, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Out of three buttons, one button is not working
No, it doesn't, I put breakpoint under onclick() but control doesn't come under it. On May 11, 8:14 pm, viktor victor.scherb...@gmail.com wrote: Is Button selector switches if you push the Button? On 11 Тра, 15:28,mack2978smashmah...@gmail.com wrote: Hi All, I am baffling with below issue. Out of three buttons, save button is not working and its onclick is not hitting. Any idea anyone. below code and XML i am using. setContentView(R.layout.myimageview); mImageView = (ImageView) findViewById(R.id.imageview); mImageView.setDrawingCacheEnabled(true); mImageView.setImageResource(param1); mslideshow = (ImageButton)findViewById(R.id.slideshow); mSave = (ImageButton)findViewById(R.id.msave); mslideshow.setOnClickListener(new OnClickListener() { public void onClick(View view) { Intent MyIntent = new Intent(myimageview.this, slideshowview.class); startActivity(MyIntent); } }); mSave.setOnClickListener(new OnClickListener() { public void onClick(View view) { saveWallpaperToSD(saveFile+.png); updateExternalStorageState(); } }); msetwallpaper = (ImageButton) findViewById(R.id.setwallpaper); msetwallpaper.setOnClickListener(new OnClickListener() { public void onClick(View view) { wallpaperManager.setWallpaperOffsetSteps(0.5f, 0.5f); wallpaperManager.setWallpaperOffsets(view.getRootView().getWindowToken(), 0.5f, 0.5f); //wallpaperManager.suggestDesiredDimensions(320, 480); try { wallpaperManager.setBitmap(mImageView.getDrawingCache()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finish(); } }); XML: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/inner_bg ImageView android:layout_width=fill_parent android:layout_height=435dp android:id=@+id/imageview android:adjustViewBounds=true android:gravity=center/ ImageButton android:id=@+id/setwallpaper style=@android:style/Widget.Button.Inset android:src=@drawable/btn_setwallpaper android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/imageview / ImageButton android:id=@+id/msave style=@android:style/Widget.Button.Inset android:src=@drawable/btn_save android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/slideshow android:layout_alignRight=@+id/setwallpaper android:onClick=selfDestruct / ImageButton android:id=@+id/slideshow style=@android:style/Widget.Button.Inset android:src=@drawable/btn_slideshow android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignRight=@+id/imageview / /RelativeLayout thanks, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Out of three buttons, one button is not working
It's magic, Try to use android:layout_toRightOf=@id/. I guess one of yours button overlapped center button, try to play with layout. On 11 Тра, 18:52, mack2978 smashmah...@gmail.com wrote: No, it doesn't, I put breakpoint under onclick() but control doesn't come under it. On May 11, 8:14 pm, viktor victor.scherb...@gmail.com wrote: Is Button selector switches if you push the Button? On 11 Тра, 15:28,mack2978smashmah...@gmail.com wrote: Hi All, I am baffling with below issue. Out of three buttons, save button is not working and its onclick is not hitting. Any idea anyone. below code and XML i am using. setContentView(R.layout.myimageview); mImageView = (ImageView) findViewById(R.id.imageview); mImageView.setDrawingCacheEnabled(true); mImageView.setImageResource(param1); mslideshow = (ImageButton)findViewById(R.id.slideshow); mSave = (ImageButton)findViewById(R.id.msave); mslideshow.setOnClickListener(new OnClickListener() { public void onClick(View view) { Intent MyIntent = new Intent(myimageview.this, slideshowview.class); startActivity(MyIntent); } }); mSave.setOnClickListener(new OnClickListener() { public void onClick(View view) { saveWallpaperToSD(saveFile+.png); updateExternalStorageState(); } }); msetwallpaper = (ImageButton) findViewById(R.id.setwallpaper); msetwallpaper.setOnClickListener(new OnClickListener() { public void onClick(View view) { wallpaperManager.setWallpaperOffsetSteps(0.5f, 0.5f); wallpaperManager.setWallpaperOffsets(view.getRootView().getWindowToken(), 0.5f, 0.5f); //wallpaperManager.suggestDesiredDimensions(320, 480); try { wallpaperManager.setBitmap(mImageView.getDrawingCache()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finish(); } }); XML: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/inner_bg ImageView android:layout_width=fill_parent android:layout_height=435dp android:id=@+id/imageview android:adjustViewBounds=true android:gravity=center/ ImageButton android:id=@+id/setwallpaper style=@android:style/Widget.Button.Inset android:src=@drawable/btn_setwallpaper android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/imageview / ImageButton android:id=@+id/msave style=@android:style/Widget.Button.Inset android:src=@drawable/btn_save android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/slideshow android:layout_alignRight=@+id/setwallpaper android:onClick=selfDestruct / ImageButton android:id=@+id/slideshow style=@android:style/Widget.Button.Inset android:src=@drawable/btn_slideshow android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignRight=@+id/imageview / /RelativeLayout thanks, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Out of three buttons, one button is not working
Great Viktor...It worked..but still i am clueless why it not worked using layout_alignRight? Anyways thanks.. On May 11, 9:14 pm, viktor victor.scherb...@gmail.com wrote: It's magic, Try to use android:layout_toRightOf=@id/. I guess one of yours button overlapped center button, try to play with layout. On 11 Тра, 18:52,mack2978smashmah...@gmail.com wrote: No, it doesn't, I put breakpoint under onclick() but control doesn't come under it. On May 11, 8:14 pm, viktor victor.scherb...@gmail.com wrote: Is Button selector switches if you push the Button? On 11 Тра, 15:28,mack2978smashmah...@gmail.com wrote: Hi All, I am baffling with below issue. Out of three buttons, save button is not working and its onclick is not hitting. Any idea anyone. below code and XML i am using. setContentView(R.layout.myimageview); mImageView = (ImageView) findViewById(R.id.imageview); mImageView.setDrawingCacheEnabled(true); mImageView.setImageResource(param1); mslideshow = (ImageButton)findViewById(R.id.slideshow); mSave = (ImageButton)findViewById(R.id.msave); mslideshow.setOnClickListener(new OnClickListener() { public void onClick(View view) { Intent MyIntent = new Intent(myimageview.this, slideshowview.class); startActivity(MyIntent); } }); mSave.setOnClickListener(new OnClickListener() { public void onClick(View view) { saveWallpaperToSD(saveFile+.png); updateExternalStorageState(); } }); msetwallpaper = (ImageButton) findViewById(R.id.setwallpaper); msetwallpaper.setOnClickListener(new OnClickListener() { public void onClick(View view) { wallpaperManager.setWallpaperOffsetSteps(0.5f, 0.5f); wallpaperManager.setWallpaperOffsets(view.getRootView().getWindowToken(), 0.5f, 0.5f); //wallpaperManager.suggestDesiredDimensions(320, 480); try { wallpaperManager.setBitmap(mImageView.getDrawingCache()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finish(); } }); XML: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/inner_bg ImageView android:layout_width=fill_parent android:layout_height=435dp android:id=@+id/imageview android:adjustViewBounds=true android:gravity=center/ ImageButton android:id=@+id/setwallpaper style=@android:style/Widget.Button.Inset android:src=@drawable/btn_setwallpaper android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/imageview / ImageButton android:id=@+id/msave style=@android:style/Widget.Button.Inset android:src=@drawable/btn_save android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/slideshow android:layout_alignRight=@+id/setwallpaper android:onClick=selfDestruct / ImageButton android:id=@+id/slideshow style=@android:style/Widget.Button.Inset android:src=@drawable/btn_slideshow android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignRight=@+id/imageview / /RelativeLayout thanks, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Out of three buttons, one button is not working
The documentation explains that pretty well actually. http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html layout_alignRight - Makes the right edge of this view match the right edge of the given anchor view ID. layout_alignLeft - Makes the left edge of this view match the left edge of the given anchor view ID. layout_toLeftOf - Positions the right edge of this view to the left of the given anchor view ID. layout_toRightOf - Positions the left edge of this view to the right of the given anchor view ID. It looks like you are trying to have the three buttons in one line below the image view in the order - setwallpaper, msave, slideshow. So you would want msave (the center button) toLeftOf slideshow and toRightOf setwallpaper. On May 11, 12:58 pm, mack2978 smashmah...@gmail.com wrote: Great Viktor...It worked..but still i am clueless why it not worked using layout_alignRight? Anyways thanks.. On May 11, 9:14 pm, viktor victor.scherb...@gmail.com wrote: It's magic, Try to use android:layout_toRightOf=@id/. I guess one of yours button overlapped center button, try to play with layout. On 11 Тра, 18:52,mack2978smashmah...@gmail.com wrote: No, it doesn't, I put breakpoint under onclick() but control doesn't come under it. On May 11, 8:14 pm, viktor victor.scherb...@gmail.com wrote: Is Button selector switches if you push the Button? On 11 Тра, 15:28,mack2978smashmah...@gmail.com wrote: Hi All, I am baffling with below issue. Out of three buttons, save button is not working and its onclick is not hitting. Any idea anyone. below code and XML i am using. setContentView(R.layout.myimageview); mImageView = (ImageView) findViewById(R.id.imageview); mImageView.setDrawingCacheEnabled(true); mImageView.setImageResource(param1); mslideshow = (ImageButton)findViewById(R.id.slideshow); mSave = (ImageButton)findViewById(R.id.msave); mslideshow.setOnClickListener(new OnClickListener() { public void onClick(View view) { Intent MyIntent = new Intent(myimageview.this, slideshowview.class); startActivity(MyIntent); } }); mSave.setOnClickListener(new OnClickListener() { public void onClick(View view) { saveWallpaperToSD(saveFile+.png); updateExternalStorageState(); } }); msetwallpaper = (ImageButton) findViewById(R.id.setwallpaper); msetwallpaper.setOnClickListener(new OnClickListener() { public void onClick(View view) { wallpaperManager.setWallpaperOffsetSteps(0.5f, 0.5f); wallpaperManager.setWallpaperOffsets(view.getRootView().getWindowToken(), 0.5f, 0.5f); //wallpaperManager.suggestDesiredDimensions(320, 480); try { wallpaperManager.setBitmap(mImageView.getDrawingCache()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finish(); } }); XML: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/inner_bg ImageView android:layout_width=fill_parent android:layout_height=435dp android:id=@+id/imageview android:adjustViewBounds=true android:gravity=center/ ImageButton android:id=@+id/setwallpaper style=@android:style/Widget.Button.Inset android:src=@drawable/btn_setwallpaper android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/imageview / ImageButton android:id=@+id/msave style=@android:style/Widget.Button.Inset android:src=@drawable/btn_save android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/imageview android:layout_alignLeft=@+id/slideshow android:layout_alignRight=@+id/setwallpaper android:onClick=selfDestruct