Hi max , thanks for reply and sorry for replying u so late :) I tried all the approaches in above code , but i didnt get the desired result . While debuging i can see that the view area is always null .. Is there some other approach to do this
On Apr 28, 11:22 pm, Max Gilead <[email protected]> wrote: > Sudheendra, this is what I dug out from the depths of my SVN repo :) I told > you it was simple, didn't I? :) > > If you don't have a current view you can get it using > getWindow().getDecorView(). > > HTH, > Max > > private static void screenshot(View view) { > view.setDrawingCacheEnabled(true); > Bitmap screenshot = view.getDrawingCache(false); > > String filename = "screenshot.png"; > try { > File f = new File(Environment.getExternalStorageDirectory(), > filename); > f.createNewFile(); > OutputStream outStream = new FileOutputStream(f); > screenshot.compress(Bitmap.CompressFormat.PNG, 100, outStream); > outStream.close(); > } catch (IOException e) { > e.printStackTrace(); > } > view.setDrawingCacheEnabled(false); > } > > On 28 April 2010 07:43, Sudheendra <[email protected]> wrote: > > > > > > > Thanks Max , I will check out he app , also please let me know the > > code. > > > Thanks a lot > > > On Apr 28, 6:07 am, Max Gilead <[email protected]> wrote: > > > You don't need to root your phone. While not obvious it's quite easy. I > > > should have some code for that,I'll try to find it tomorrow if you still > > > need it (it's for capturing screenshot of your Activity). Capturing > > phone's > > > desktop is also possible w/o rooting, see iSteam app from the Market but > > I > > > never tried that. > > > Cheers, > > > Max > > > > On 27 Apr 2010 09:01, "Sudheendra" <[email protected]> wrote: > > > > Thanks String , Thanks John ... > > > So using rooted phone how can i do it ???? > > > > On Apr 27, 12:38 pm, String <[email protected]> wrote:> On > > Apr 27, 7:54 am, Sudheendra... > > > > For more options, visit this group athttp:// > > > > groups.google.com/group/android-developers?hl=en > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" ... > > > > -- > > > 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%2Bunsubs > > > [email protected]> > > > For more options, visit this group athttp:// > > groups.google.com/group/android-developers?hl=en > > > -- > > 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%2Bunsubs > > [email protected]> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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

