Search Results

Search found 2 results on 1 pages for 'smsys'.

Page 1/1 | 1 

  • retrieve image from gallery in android

    - by smsys
    I have created an Activity where i have a Button. By pressing the button an android Gallery opens. When i choose an image from the gallery it is shows it in an ImageView of my Activity but after choosing second time the following error occuring 01-13 17:55:25.323: ERROR/AndroidRuntime(14899): java.lang.OutOfMemoryError: bitmap size exceeds VM budget Here is the source code i am using: public class MyImage extends Activity { /** Called when the activity is first created. */ Gallery gallery; private Uri[] mUrls; String[] mFiles=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getDataDirectory(); File[] imagelist = images.listFiles(); mFiles = new String[imagelist.length]; for(int i= 0 ; i< imagelist.length; i++) { mFiles[i] = imagelist[i].getAbsolutePath(); } mUrls = new Uri[mFiles.length]; for(int i=0; i < mFiles.length; i++) { mUrls[i] = Uri.parse(mFiles[i]); } Gallery g = (Gallery) findViewById(R.id.Gallery01); g.setAdapter(new ImageAdapter(this)); g.setFadingEdgeLength(40); } public class ImageAdapter extends BaseAdapter{ int mGalleryItemBackground; public ImageAdapter(Context c) { mContext = c; } public int getCount(){ return mUrls.length; } public Object getItem(int position){ return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent){ ImageView i = new ImageView(mContext); i.setImageURI(mUrls[position]); i.setScaleType(ImageView.ScaleType.FIT_XY); i.setLayoutParams(new Gallery.LayoutParams(260, 210)); return i; } private Context mContext; } }

    Read the article

  • jQuery Fancy - popup window doesn't fully expand

    - by fmz
    I am using jQuery Fancybox to display a number of Flash videos on a site and I am having trouble with the window not opening fully on the first click in Firefox. It works fine in other browsers. Here is the jQuery: <script type="text/javascript"> $(document).ready(function() { $("a.videoLink").fancybox({ 'titleShow' : false, 'autoscale' : true, 'width' : '820', 'height' : '620', 'transitionIn' : 'elastic', 'transitionOut' : 'elastic' }); }); </script> Here is the html: <tr> <td class="title"><a class="videoLink" href="#video-content30">CPR Lesson 1 Movie</a></td> <td class="time">38:39</td> <td class="video" style="display:none"> <div id="video-content30"> <script type='text/javascript'> var flashvars = { file: 'http://www.stockmarketcpr.com/smsys/link/CPR-Lesson-1-Movie.flv', id: '30' }; var params = { wmode: 'opaque', bgcolor: '#CCCCCC', allowfullscreen: 'true', allowscriptaccess: 'always' }; swfobject.embedSWF('http://www.stockmarketcpr.com/_flash/player.swf', 'player30','800','600', '9.0.0','expressInstall.swf', flashvars, params); </script> <div id="player30"></div> </div> </td> </tr> I end up getting a quarter inch high, full-width window on the first click. The second click plays fine. I would appreciate any assistance. Thank you!

    Read the article

1