0

My app works fine on 480*800 phones. But it crashes on 720p phones . I tested it on galaxy s3 and xperia sl. Here is the logcat errorenter image description here

and code which is causing error according to my judgment is this

mapView = new MapView(this) {
            @Override
            public boolean onTouchEvent(MotionEvent event) {
                if (gestureDetector.onTouchEvent(event)) {
                    return true;
                }
                return super.onTouchEvent(event);
            }
        };

        mapView.setClickable(true);
        mapView.setCenter(new GeoPoint(33.698351,73.063889));
        mapView.zoom((byte) 12, 5);
        mapView.setBuiltInZoomControls(true);
        mapView.setMapFile(new File(Environment.getExternalStorageDirectory()+"/pakistan.map"));
Khayam Gondal
  • 2,366
  • 2
  • 28
  • 40
  • creating bitmap causes the error. i suggest taking a look at this question and trying to find a similar thing in your project: http://stackoverflow.com/questions/11931742/loading-large-images-without-outofmemoryerror – İsmet Alkan May 14 '13 at 18:26
  • I think it is problem with mapView. That mapView tiles size may be too large. But if so how can i set it. Because its in mapsforge API. – Khayam Gondal May 14 '13 at 18:39
  • i searched through outofmemory posts for mapsforge api, i suggest doing the same. however, the answers were just saying that the file is too big for the approach. so, i suggest using other possible ways than mapsforge api. – İsmet Alkan May 14 '13 at 18:42
  • i figure it out. Just decreased the view width and height. Thanks btw. – Khayam Gondal May 14 '13 at 19:13

0 Answers0