Search Results

Search found 15838 results on 634 pages for 'android layout'.

Page 18/634 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Angry Bird Makers: Developers Love iOS Over Android To Make Money

    - by Gopinath
    These days web is buzzing with Apple iOS vs Google Android debates. Recently Fortune predicted that Android is going to explode in 2011 and it will surpass Apple’s iOS market share. Yes Android is set to spread its wings across all the devices – smartphones, TVs, set top boxes, in car entertainment devices, what not. Think of any device that requires operating system, Android can be used. On the other than iOS is only available on very selective Apple devices – iPods, iPhones and iPads. When it comes to the count of devices running on a specific OS, Android will be far ahead of iOS but when you consider a quality of devices and providing an eco system for business to make money iOS seems to be the winner. That is what experts and analysts are saysing. Here is an excerpt from Peter Vesterbacka, maker of the popular Angry Birds game, interview to Tech N Marketing site.  He says Apple will be the number one platform for a long time from a developer perspective, they have gotten so many things right. And they know what they are doing and they call the shots. Android is growing, but it’s also growing complexity at the same time. Device fragmentation not the issue, but rather the fragmentation of the ecosystem. So many different shops, so many different models. The carriers messing with the experience again. Open but not really open, a very Google centric ecosystem. And paid content just doesn’t work on Android. Peter says developer prefer iOS over Android as it’s not very easy to make money on Android market. That’s why they released a free version of Angry Birds game with ads support for Android devices. Free is the way to go with Android. Nobody has been successful selling content on Android. We will offer a way to remove the ads by paying for the app, but we don’t expect that to be a huge revenue stream. You can read full interview here. cc image credit: flickr/johanl This article titled,Angry Bird Makers: Developers Love iOS Over Android To Make Money, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • ImageView bounds are larger than expected in android layout

    - by Hamy
    Hey all, This is a layout that I have defined in an app. As you can see, I would like the TextView "@details/image_time_counter" to be aligned with the bottom right of the image. Unfortunately, this is currently what shows - app - hierarchy viewer all - HV part 2. HierarchyViewer reports that the ImageView has bounds much bigger than what I am expecting. Can anyone explain these bounds, or just tell me how to make the bounds be the same as the image size? Thanks, Hamy <RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> </RelativeLayout>

    Read the article

  • ListView is Widget(View) or Layout(Viewgroup)?

    - by Manoj Maurya
    Hi All, I need your help to explore few topics in Android. My understanding is Widget is View and Layout is ViewGroups in Android. I described the problems as below- Please go through the below links- developer.android.com/guide/topics/ui/custom-components.html- (add http:// in the beginning) developer.android.com/resources/tutorials/views/index.html - (add http:// in the beginning) In the first link ListView is included as Widget and in the Second link ListView has been shown as Layout. So, is ListView is Widget(View) or Layout(Viewgroup)? Same is the case for Spinner in Andriod developer.android.com/resources/tutorials/views/hello-spinner.html- (add http:// in the beginning) (Link- says Spinner is Widget(View)) developer.android.com/guide/topics/ui/layout-objects.html- (add http:// in the beginning) says Spinner is Layout(ViewGroup) So, Spinner is View or ViewGroup? Please update me with your views?

    Read the article

  • How to obtain listview information without refreshing the page?

    - by user1808098
    I am currently developing an Android Application for my Final Year Project. But to be honest I do not have any basic knowledges and everything started from scratch and referring to online tutorials a lot. Here is my question, I was trying to retrieve data from listview activity. There are two listview in my page using button. I was able to display the first listview but when it get data for the second listview, the data for first listview is disappeared because the page is refreshed, vice versa. What code should I modified to get both the data in the page? (Database not implemented yet) Please help, thanks a lot. Below are my codings. Codings for XML. <!-- Location --> <TextView android:id="@+id/TextViewLocation" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:layout_marginBottom="10dip" android:text="Location Information" android:gravity="center" android:textSize="15dip" android:textColor="#025f7c"/> <!-- Condition Label --> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#372c24" android:text="Traffic Condition"/> <Button android:id="@+id/inputListView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:layout_marginBottom="10dip" android:text="choose one..."/> <!-- Comment Label --> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#372c24" android:text="What's Happening?"/> <Button android:id="@+id/inputListView2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:layout_marginBottom="10dip" android:text="choose one..."/> <!-- Suggestion Label --> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#372c24" android:text="Comments / Suggestion"/> <EditText android:layout_width="fill_parent" android:layout_height="80dp" android:layout_marginTop="5dip" android:layout_marginBottom="10dip" android:singleLine="true"/> <!-- Image button --> <Button android:id="@+id/btnImage" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:text="Upload Image"/> <!-- Report button --> <Button android:id="@+id/btnReportCheckin" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:text="Report"/> <!-- Link to Logout --> <TextView android:id="@+id/linkLogout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:layout_marginBottom="40dip" android:text="Log Out" android:gravity="center" android:textSize="20dip" android:textColor="#025f7c"/> </LinearLayout> <!-- Check or Report Form Ends --> Codings for Activity Class public class CheckinActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set View to checkin.xml setContentView(R.layout.checkin); /* TextView LocationView = (TextView) findViewById(R.id.TextViewLocation); Intent h = getIntent(); // getting attached intent data String address = h.getStringExtra("address"); // displaying selected product name LocationView.setText(address); */ Button ListViewScreen = (Button) findViewById(R.id.inputListView); //Listening to Button ListViewScreen.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //Switching to ListView Screen Intent i = new Intent(getApplicationContext(), ListViewActivity.class); startActivity(i); } } ); Button SelectedView = (Button) findViewById(R.id.inputListView); Intent i = getIntent(); // getting attached intent data String product = i.getStringExtra("product"); // displaying selected product name SelectedView.setText(product); Button ListView2Screen = (Button) findViewById(R.id.inputListView2); //Listening to Button ListView2Screen.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //Switching to ListView Screen Intent j = new Intent(getApplicationContext(), ListView2Activity.class); startActivity(j); } } ); Button SelectedView2 = (Button) findViewById(R.id.inputListView2); Intent j = getIntent(); // getting attached intent data String product2 = j.getStringExtra("product2"); // displaying selected product name SelectedView2.setText(product2); TextView Logout = (TextView) findViewById(R.id.linkLogout); // Listening to Log out Logout.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { // Closing menu screen // Switching to Login Screen/closing register screen finish(); } }); } } Coding for listview class public class ListViewActivity extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // storing string resources into Array String[] traffic_condition = getResources().getStringArray(R.array.traffic_condition); // Binding resources Array to ListAdapter this.setListAdapter(new ArrayAdapter<String>(this, R.layout.listitem, R.id.listViewLayout, traffic_condition)); ListView lv = getListView(); // listening to single list item on click lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // selected item String product = ((TextView) view).getText().toString(); // Launching new Activity on selecting single List Item Intent i = new Intent(getApplicationContext(), CheckinActivity.class); // sending data to new activity i.putExtra("product", product); startActivity(i); } }); } } Hope I made myself clear, I can provide a screen shot of my apps if it is required, thanks!

    Read the article

  • Change keyboard layout while entering start-up password.

    - by Rogue
    I installed Windows 7 with the QWERTY keyboard layout, but have recently started using DVORAK layout so I changed it from Control Panel - Regional and Language Settings and it set DVORAK to default keyboard layout. Recently I added a password to log into the administrator account, the problem is that this password field is set to the QWERTY keyboard layout. When I log into Windows the keyboard layout switches back to DVORAK. How can I set the password field on the log in screen to use the DVORAK layout

    Read the article

  • Marking Current Location on Map, Android

    - by deewangan
    Hi every one, i followed some tutorials to create an application that shows the current position of the user on the map with a marking. but for some reasons i can't get to work the marking part? the other parts works well, but whenever i add the marking code the application crashes. i hope someone could help me.here is the code: public class LocationActivity extends MapActivity { /** Called when the activity is first created. */ private MapView mapView; private LocationManager lm; private LocationListener ll; private MapController mc; GeoPoint p = null; Drawable defaultMarker = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView)findViewById(R.id.mapView); //show zoom in/out buttons mapView.setBuiltInZoomControls(true); //Standard view of the map(map/sat) mapView.setSatellite(false); //get controller of the map for zooming in/out mc = mapView.getController(); // Zoom Level mc.setZoom(18); MyLocationOverlay myLocationOverlay = new MyLocationOverlay(); List<Overlay> list = mapView.getOverlays(); list.add(myLocationOverlay); lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); ll = new MyLocationListener(); lm.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, ll); //Get the current location in start-up GeoPoint initGeoPoint = new GeoPoint( (int)(lm.getLastKnownLocation( LocationManager.GPS_PROVIDER) .getLatitude()*1000000), (int)(lm.getLastKnownLocation( LocationManager.GPS_PROVIDER) .getLongitude()*1000000)); mc.animateTo(initGeoPoint); } protected class MyLocationOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { Paint paint = new Paint(); super.draw(canvas, mapView, shadow); // Converts lat/lng-Point to OUR coordinates on the screen. Point myScreenCoords = new Point(); mapView.getProjection().toPixels(p, myScreenCoords); paint.setStrokeWidth(1); paint.setARGB(255, 255, 255, 255); paint.setStyle(Paint.Style.STROKE); Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.push); canvas.drawBitmap(bmp, myScreenCoords.x, myScreenCoords.y, paint); canvas.drawText("I am here...", myScreenCoords.x, myScreenCoords.y, paint); return true; } } private class MyLocationListener implements LocationListener{ public void onLocationChanged(Location argLocation) { // TODO Auto-generated method stub GeoPoint myGeoPoint = new GeoPoint( (int)(argLocation.getLatitude()*1000000), (int)(argLocation.getLongitude()*1000000)); /* * it will show a message on * location change Toast.makeText(getBaseContext(), "New location latitude [" +argLocation.getLatitude() + "] longitude [" + argLocation.getLongitude()+"]", Toast.LENGTH_SHORT).show(); */ mc.animateTo(myGeoPoint); } public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } } protected boolean isRouteDisplayed() { return false; } } here is the logcat: 01-19 05:31:43.011: DEBUG/AndroidRuntime(759): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< 01-19 05:31:43.011: DEBUG/AndroidRuntime(759): CheckJNI is ON 01-19 05:31:43.411: DEBUG/AndroidRuntime(759): --- registering native functions --- 01-19 05:31:43.431: INFO/jdwp(759): received file descriptor 19 from ADB 01-19 05:31:43.431: INFO/jdwp(759): Ignoring second debugger -- accepting and dropping 01-19 05:31:44.531: INFO/ActivityManager(583): Starting activity: Intent { flg=0x10000000 cmp=pro.googlemapp/.LocationActivity } 01-19 05:31:44.641: DEBUG/AndroidRuntime(759): Shutting down VM 01-19 05:31:44.641: DEBUG/dalvikvm(759): DestroyJavaVM waiting for non-daemon threads to exit 01-19 05:31:44.641: DEBUG/dalvikvm(759): DestroyJavaVM shutting VM down 01-19 05:31:44.641: DEBUG/dalvikvm(759): HeapWorker thread shutting down 01-19 05:31:44.651: DEBUG/dalvikvm(759): HeapWorker thread has shut down 01-19 05:31:44.651: DEBUG/jdwp(759): JDWP shutting down net... 01-19 05:31:44.651: DEBUG/jdwp(759): +++ peer disconnected 01-19 05:31:44.651: INFO/dalvikvm(759): Debugger has detached; object registry had 1 entries 01-19 05:31:44.661: DEBUG/dalvikvm(759): VM cleaning up 01-19 05:31:44.681: INFO/ActivityManager(583): Start proc pro.googlemapp for activity pro.googlemapp/.LocationActivity: pid=770 uid=10025 gids={3003} 01-19 05:31:44.761: DEBUG/dalvikvm(759): LinearAlloc 0x0 used 676436 of 4194304 (16%) 01-19 05:31:44.801: INFO/jdwp(770): received file descriptor 20 from ADB 01-19 05:31:44.822: INFO/dalvikvm(770): ignoring registerObject request in thread=3 01-19 05:31:44.851: INFO/jdwp(770): Ignoring second debugger -- accepting and dropping 01-19 05:31:44.851: ERROR/jdwp(770): Failed writing handshake bytes: Broken pipe (-1 of 14) 01-19 05:31:44.851: INFO/dalvikvm(770): Debugger has detached; object registry had 0 entries 01-19 05:31:45.320: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings 01-19 05:31:45.320: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings 01-19 05:31:45.340: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings 01-19 05:31:45.781: DEBUG/LocationManager(770): Constructor: service = android.location.ILocationManager$Stub$Proxy@4379d9f0 01-19 05:31:45.791: WARN/GpsLocationProvider(583): Duplicate add listener for uid 10025 01-19 05:31:45.791: DEBUG/GpsLocationProvider(583): setMinTime 0 01-19 05:31:45.791: DEBUG/GpsLocationProvider(583): startNavigating 01-19 05:31:45.831: INFO/jdwp(770): received file descriptor 27 from ADB 01-19 05:31:46.001: INFO/MapActivity(770): Handling network change notification:CONNECTED 01-19 05:31:46.001: ERROR/MapActivity(770): Couldn't get connection factory client 01-19 05:31:46.451: DEBUG/dalvikvm(770): GC freed 4539 objects / 298952 bytes in 118ms 01-19 05:31:46.470: DEBUG/AndroidRuntime(770): Shutting down VM 01-19 05:31:46.470: WARN/dalvikvm(770): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) 01-19 05:31:46.481: ERROR/AndroidRuntime(770): Uncaught handler: thread main exiting due to uncaught exception 01-19 05:31:46.541: ERROR/AndroidRuntime(770): java.lang.NullPointerException 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.google.android.maps.PixelConverter.toPixels(PixelConverter.java:58) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.google.android.maps.PixelConverter.toPixels(PixelConverter.java:48) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at pro.googlemapp.LocationActivity$MyLocationOverlay.draw(LocationActivity.java:101) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.google.android.maps.MapView.onDraw(MapView.java:476) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.View.draw(View.java:6274) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.drawChild(ViewGroup.java:1526) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.drawChild(ViewGroup.java:1524) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.View.draw(View.java:6277) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.widget.FrameLayout.draw(FrameLayout.java:352) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.drawChild(ViewGroup.java:1526) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.drawChild(ViewGroup.java:1524) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.View.draw(View.java:6277) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.widget.FrameLayout.draw(FrameLayout.java:352) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewRoot.draw(ViewRoot.java:1332) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewRoot.performTraversals(ViewRoot.java:1097) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewRoot.handleMessage(ViewRoot.java:1613) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.os.Handler.dispatchMessage(Handler.java:99) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.os.Looper.loop(Looper.java:123) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.app.ActivityThread.main(ActivityThread.java:4203) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at java.lang.reflect.Method.invokeNative(Native Method) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at java.lang.reflect.Method.invoke(Method.java:521) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at dalvik.system.NativeStart.main(Native Method) 01-19 05:31:46.551: INFO/Process(583): Sending signal. PID: 770 SIG: 3 01-19 05:31:46.581: INFO/dalvikvm(770): threadid=7: reacting to signal 3 01-19 05:31:46.661: INFO/dalvikvm(770): Wrote stack trace to '/data/anr/traces.txt' 01-19 05:31:46.871: INFO/ARMAssembler(583): generated scanline__00000077:03515104_00000000_00000000 [ 27 ipp] (41 ins) at [0x2c69c8:0x2c6a6c] in 973448 ns 01-19 05:31:46.911: INFO/ARMAssembler(583): generated scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at [0x2c6a70:0x2c6bc0] in 1985378 ns 01-19 05:31:49.881: INFO/Process(770): Sending signal. PID: 770 SIG: 9 01-19 05:31:49.931: INFO/ActivityManager(583): Process pro.googlemapp (pid 770) has died. 01-19 05:31:49.941: WARN/GpsLocationProvider(583): Unneeded remove listener for uid 1000 01-19 05:31:49.941: DEBUG/GpsLocationProvider(583): stopNavigating 01-19 05:31:49.951: INFO/WindowManager(583): WIN DEATH: Window{438891c0 pro.googlemapp/pro.googlemapp.LocationActivity paused=false} 01-19 05:31:50.111: WARN/UsageStats(583): Unexpected resume of com.android.launcher while already resumed in pro.googlemapp 01-19 05:31:50.200: WARN/InputManagerService(583): Got RemoteException sending setActive(false) notification to pid 770 uid 10025

    Read the article

  • Android App crashing on Back Button (performResumeActivity)

    - by Rutger
    My App consists of 2 Activities at the moment. . the MAIN activity with a Gallery View . a FriendsListActivity with a ListView When the user moves away from the FriendsListActivity with the back button, and returns to the MAIN activity the following error keeps popping up in debug mode. DalvikVM[localhost:8676] Thread [<1 main] (Suspended (exception RuntimeException)) ActivityThread.performResumeActivity(IBinder, boolean) line: 2095 ActivityThread.handleResumeActivity(IBinder, boolean, boolean) line: 2110 BinderProxy(ActivityThread$H).handleMessage(Message) line: 954 ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 3647 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 507 ZygoteInit$MethodAndArgsCaller.run() line: 839 ZygoteInit.main(String[]) line: 597 NativeStart.main(String[]) line: not available [native method] Thread [<8 Binder Thread #2] (Running) Thread [<7 Binder Thread #1] (Running) With the LogCat 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): FATAL EXCEPTION: main 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): java.lang.RuntimeException: Unable to resume activity {com.package.MAIN/com.package.MAIN.MAIN}: java.lang.NullPointerException 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2095) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2110) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:954) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.os.Handler.dispatchMessage(Handler.java:99) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.os.Looper.loop(Looper.java:123) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread.main(ActivityThread.java:3647) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at java.lang.reflect.Method.invokeNative(Native Method) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at java.lang.reflect.Method.invoke(Method.java:507) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at dalvik.system.NativeStart.main(Native Method) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): Caused by: java.lang.NullPointerException 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at com.package.MAIN.MAIN.onResume(MAIN.java:91) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.Activity.performResume(Activity.java:3833) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2085) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): ... 10 more Further info in the Variables panel states: this: ActivityThread e: NullPointerException cause: NullPointerException detailMessage: null stackTrace: null r: ActivityThread$ActivityClientRecord activity: MAIN detailMessage after one Eclipse Resume: Unable to resume activity (MAIN) The code from the FriendsListActivity looks like this public class FriendsListActivity extends ListActivity { // =========================================================== // Fields // =========================================================== private ArrayList<Friend> friends = new ArrayList<Friend>(); private FriendsArrayAdapter friendsArrayAdapter; private ListView listView; // =========================================================== // onCreate // =========================================================== @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.friends_list); registerForContextMenu(getListView()); setButtonNewFriendClickListener(); } public void generateFriendsList() { FriendsService fs = new FriendsService(this); friends = fs.getFriendsList(); listView = (ListView) findViewById(android.R.id.list); friendsArrayAdapter = new FriendsArrayAdapter( this, R.layout.friend_list_item, friends); listView.setAdapter(friendsArrayAdapter); } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.friends_context_menu, menu); } @Override public boolean onContextItemSelected(MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); FriendsService fs = new FriendsService(this); Friend f = new Friend(); f = friends.get(info.position); switch (item.getItemId()) { case R.id.edit: Intent i = new Intent(this, FriendEditActivity.class); i.putExtra("userid", f.userId); startActivity(i); return true; case R.id.delete: fs.deleteFriend(f.userId); generateFriendsList(); return true; default: return super.onContextItemSelected(item); } } // =========================================================== // onPause // =========================================================== protected void onPause() { super.onPause(); finish(); } // =========================================================== // onResume // =========================================================== protected void onResume() { super.onResume(); generateFriendsList(); } // =========================================================== // onStop // =========================================================== protected void onStop() { super.onStop(); } // =========================================================== // onDestroy // =========================================================== @Override protected void onDestroy() { super.onDestroy(); } // =========================================================== // Activity methods // =========================================================== private void setButtonNewFriendClickListener() { Button clickButton = (Button)findViewById(R.id.button_add_friend); clickButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent i = new Intent(v.getContext(), FriendNewActivity.class); startActivity(i); } }); } The AndroidManifest looks like this <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.package.mypackage"> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name="com.package.mypackage.mypackage" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".FriendsListActivity"></activity> <activity android:name=".FriendEditActivity"></activity> <activity android:name=".FriendNewActivity"></activity> <activity android:name=".TakePictureActivity"></activity> <activity android:name=".FriendsService"></activity> <activity android:name=".MyService"></activity> </application> <uses-sdk android:minSdkVersion="9" /> The MAIN activity looks like this: package com.package.mypackage; import java.util.ArrayList; import com.package.domain.Domain; import com.package.service.MyService; import com.package.viewadapter.myImageAdapter; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.Window; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemLongClickListener; import android.widget.Button; import android.widget.Gallery; import android.widget.Toast; public class myActivity extends Activity { // =========================================================== // Fields // =========================================================== private MyImageAdapter myImageAdapter; private ArrayList<Domain> domain = new ArrayList<Domain>(); // =========================================================== // onCreate // =========================================================== @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); /* Set Buttons to listen for any click event. */ setButtonFriendsClickListener(); setButtonCameraClickListener(); setButtonPreferencesClickListener(); } // =========================================================== // onStart // =========================================================== @Override public void onStart() { super.onStart(); /* Find the gallery defined in the main.xml */ Gallery g = (Gallery) findViewById(R.id.gallery); /* Show a Toast message when image is clicked */ g.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { MyImageAdapter image_ID = new MyImageAdapter(myActivity.this, position, null); if (image_ID.getItemId(position) == 0) { Toast test_toast = Toast.makeText(myActivity.this, "This is the New Image click", Toast.LENGTH_SHORT); test_toast.show(); } else { Toast test_toast = Toast.makeText(myActivity.this, "The clicked image has image number " + image_ID.getItemId(position) + " in the imageadapter.", Toast.LENGTH_SHORT); test_toast.show(); } } }); g.setOnItemLongClickListener(new OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View v, int position, long id) { MyImageAdapter image_ID = new MyImageAdapter(myActivity.this, position, null); Toast test_toast = Toast.makeText(myActivity.this, "The long clicked image has image number " + image_ID.getItemId(position) + " in the imageadapter.", Toast.LENGTH_SHORT); test_toast.show(); return true; } }); } // =========================================================== // onPause // =========================================================== protected void onPause() { super.onPause(); } // =========================================================== // onResume // =========================================================== protected void onResume() { super.onResume(); generateMyGallery(); } // =========================================================== // onStop // =========================================================== protected void onStop() { super.onStop(); } // =========================================================== // onDestroy // Is also called when user changes from horizontal // to vertical orientation and back // =========================================================== @Override protected void onDestroy() { super.onDestroy(); } // =========================================================== // Save and Restore UI states // =========================================================== @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); } protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); } // =========================================================== // Main Activity methods // =========================================================== public void generateMyGallery() { MyService cs = new MyService(this); domain = cs.getDomainList(); // Add the new_image drawable to the ArrayList Domain d = new Domain(); d.photoLocation = "drawable"; d.photoName = "new_image"; d.extra1 = "no_text"; d.extra2 = "no_text"; domain.add(0, d); myImageAdapter = new MyImageAdapter(this, R.layout.text_overlay_image_view, domain); /* Find the gallery defined in the main.xml */ Gallery g = (Gallery) findViewById(R.id.gallery); g.setSpacing(10); /* Apply a new (custom) ImageAdapter to it. */ g.setAdapter(myImageAdapter); g.setSelection(1); } private void setButtonFriendsClickListener() { Button clickButton = (Button)findViewById(R.id.button_friends_list); clickButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { setContentView(R.layout.friends_list); Intent myIntent = new Intent(v.getContext(), FriendsListActivity.class); startActivity(myIntent); } }); } private void setButtonCameraClickListener() { Button clickButton = (Button)findViewById(R.id.button_take_picture); clickButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { setContentView(R.layout.take_picture); Intent myIntent = new Intent(v.getContext(), TakePictureActivity.class); startActivity(myIntent); } }); } private void setButtonPreferencesClickListener() { Button clickButton = (Button)findViewById(R.id.button_preferences); clickButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent myIntent = new Intent(v.getContext(), MyPreferencesActivity.class); startActivity(myIntent); } }); } }; Anyone has an idea why the App crashes. Any help is much appreciated. I did find out that, when I finish() the MAIN activity when I start the FriendListActivity and restart the MAIN activity when closing the FriendListActivity, that the crash does not occur. However, this basically restarts the App and that is not the intention. Thanks all, I got the problem solved. This is what I did. . When moving all gallery related actions to the onCreate, the creash didn't happen anymore. But then after returning to the MAIN activity, the activity wasn't shown. . I then moved all the onCreate (except the super), the generateGallery, and the onStart() to the onResume. Now it works fine!

    Read the article

  • Android Linear Layout steching

    - by Maffo
    Hi, I think that's a rather simple Question but I don't get it the way I want it to. I Want do do a Linear Layout in Android with 3 areas. The Top area should have a fixed height, fill_parent width. The second, below the first, should use all the room available, fill_parent width. The third, below the second, should have fixed height, fill_parent width. Here is what i got: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:gravity="bottom" android:background="#ff63a920"> <LinearLayout android:id="@+id/top_bar" android:layout_width="fill_parent" android:layout_height="32dp" > </LinearLayout> <com.google.android.maps.MapView android:id="@+id/mymapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:enabled="true" android:clickable="true" /> <LinearLayout android:id="@+id/bottombar" android:layout_width="fill_parent" android:layout_height="32dp" > </LinearLayout> </LinearLayout> The Problem is, that the mapview in the middle ist too big, so it pushes out the topbar. I Hope you can help me.

    Read the article

  • Android: ActivityThread.performLaunchActivity error

    - by fordays
    Hi, I'm getting an ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,Intent) error each time I boot up my program in the debugger. The program won't even start up! Any help would be greatly appreciated! I'm very new to this environment. Let me know if you need anymore information/code to help me out. Here is my logcat: 06-09 11:16:26.848: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test2' (No such file or directory) 06-09 11:16:26.848: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory) 06-09 11:16:26.848: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test' (No such file or directory) 06-09 11:16:26.848: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory) 06-09 11:16:37.887: ERROR/MemoryHeapBase(53): error opening /dev/pmem: No such file or directory 06-09 11:16:37.887: ERROR/SurfaceFlinger(53): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake 06-09 11:16:37.927: ERROR/libEGL(53): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found) 06-09 11:16:38.407: ERROR/libEGL(64): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found) 06-09 11:16:41.358: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/usb/online' 06-09 11:16:41.367: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/battery/batt_vol' 06-09 11:16:41.367: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/battery/batt_temp' 06-09 11:16:41.667: ERROR/EventHub(53): could not get driver version for /dev/input/mouse0, Not a typewriter 06-09 11:16:41.667: ERROR/EventHub(53): could not get driver version for /dev/input/mice, Not a typewriter 06-09 11:16:41.797: ERROR/System(53): Failure starting core service 06-09 11:16:41.797: ERROR/System(53): java.lang.SecurityException 06-09 11:16:41.797: ERROR/System(53): at android.os.BinderProxy.transact(Native Method) 06-09 11:16:41.797: ERROR/System(53): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146) 06-09 11:16:41.797: ERROR/System(53): at android.os.ServiceManager.addService(ServiceManager.java:72) 06-09 11:16:41.797: ERROR/System(53): at com.android.server.ServerThread.run(SystemServer.java:162) 06-09 11:16:41.797: ERROR/AndroidRuntime(53): Crash logging skipped, no checkin service 06-09 11:16:42.777: ERROR/LockPatternKeyguardView(53): Failed to bind to GLS while checking for account 06-09 11:16:46.557: ERROR/ActivityThread(111): Failed to find provider info for com.google.settings 06-09 11:16:46.577: ERROR/ActivityThread(111): Failed to find provider info for com.google.settings 06-09 11:16:49.087: ERROR/ApplicationContext(53): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml 06-09 11:16:51.146: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin 06-09 11:16:54.266: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin 06-09 11:16:54.416: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin 06-09 11:16:56.336: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound 06-09 11:16:56.356: ERROR/MediaPlayer(53): Unable to to create media player 06-09 11:16:56.637: ERROR/AndroidRuntime(201): Uncaught handler: thread main exiting due to uncaught exception 06-09 11:16:56.757: ERROR/AndroidRuntime(201): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.svgeeks.kidneytest/com.svgeeks.kidneytest.KidneyTest}: java.lang.ClassCastException: android.widget.EditText 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.os.Handler.dispatchMessage(Handler.java:99) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.os.Looper.loop(Looper.java:123) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.main(ActivityThread.java:4203) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at java.lang.reflect.Method.invokeNative(Native Method) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at java.lang.reflect.Method.invoke(Method.java:521) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at dalvik.system.NativeStart.main(Native Method) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): Caused by: java.lang.ClassCastException: android.widget.EditText 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at com.svgeeks.kidneytest.KidneyTest.onCreate(KidneyTest.java:57) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): ... 11 more 06-09 11:16:56.876: ERROR/dalvikvm(201): Unable to open stack trace file '/data/anr/traces.txt': Permission denied

    Read the article

  • is there a default back key(on device) listener in android???

    - by androidbase Praveen
    hi all, i am having two activities A and B. when i click the button in A that will shows B. when i click the Button in B it backs to A. i had set the overridePendingTransition method after the finish() method. it works properly. but in case the current Activity is B. on that time i click the default back button in the device. it shows the right to left transition to show the Activity A. how i can listen that Default back key on device.?????

    Read the article

  • Start a short video when an incoming call is detected, first case using the emulator.

    - by Emanuel
    I want to be able to start a short video on an incoming phone call. The video will loop until the call is answered. I've loaded the video onto the emulator sdcard then created the appropriate level avd with a path to the sdcard.iso file on disk. Since I'm running on a Mac OS x snow leopard I am able to confirm the contents of the sdcard. All testing has be done on the Android emulator. In a separate project TestVideo I created an activity that just launches the video from the sdcard. That works as expected. Then I created another project TestIncoming that creates an activity that creates a PhoneStateListener that overrides the onCallStateChanged(int state, String incomingNumber) method. In the onCallStateChanged() method I check if state == TelephonyManager.CALL_STATE_RINGING. If true I create an Intent that starts the video. I'm actually using the code from the TestVideo project above. Here is the code snippet. PhoneStateListener callStateListener = new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if(state == TelelphonyManager.CALL_STATE_RINGING) { Intent launchVideo = new Intent(MyActivity.this, LaunchVideo.class); startActivity(launchVideo); } } }; The PhoneStateListener is added to the TelephonyManager.listen() method like so, telephonyManager.listen(callStateListener, PhoneStateListener.LISTEN_CALL_STATE); Here is the part I'm unclear on, the manifest. What I've tried is the following: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.incomingdemo" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".IncomingVideoDemo" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.ANSWER" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name=".LaunchVideo" android:label="LaunchVideo"> </activity> </application> <uses-sdk android:minSdkVersion="2" /> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> </manifest> I've run the debugger after setting breakpoints in the IncomingVideoDemo activity where the PhoneStateListener is created and none of the breakpoints are hit. Any insights into solving this problem is greatly appreciated. Thanks.

    Read the article

  • Android Runtime Layout Tutorial

    - by Ryan
    Does anyone know how to perform or have a good reference for doing an activity layout at runtime in android? Here is the code for my activity. I'm sure I'm just neglecting to do something here: package com.isi.sa; import android.app.Activity; import android.os.Bundle; import android.widget.LinearLayout; import android.widget.TextView; public class SimpleAssessmentTest extends Activity { LinearLayout layout; TextView question; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); layout = new LinearLayout(this); question = new TextView(this); layout.setBackgroundColor(R.color.black); question.setTextColor(R.color.white); question.setText("This is question1"); layout.addView(question); } } As you can see I'm just trying to add a linear layout with a single text view (just for testing purposes) however, when the activity starts I just get a black screen with a title bar of my app name. Thanks

    Read the article

  • How do I place widgets above and below a listview?

    - by Jay Askren
    I have a list view and want to put stuff both above(on the y axis) and below(y axis) it including images, text views, and a row of buttons. Below is a simplified version of what I am creating. Unfortunately the list covers(i.e. above on the z axis) the header so the header text is not visible instead of being underneath (on the y axis) <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/footer" android:text="footer" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentBottom="true" /> <ListView android:id="@+id/list_view" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_above="@id/footer" android:background="#ff9999ff"/> <TextView android:id="@+id/header" android:text="header" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentTop="true" android:layout_above="@id/list_view" android:baselineAlignBottom="false" /> </RelativeLayout> Here is the corresponding Activity class: public class SampleListActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list_activity); } }

    Read the article

  • Different positions in ViewPager

    - by Kalai Selvan.G
    In my Application am using ViewPager to swipe the images,which comes through webservice as URL. Everything goes smoothly,the problem is while swiping myself getting the position as collapsed one.. Swipe left-right: positions are 1,2,3,4,5,etc.. if i stops swiping at 5th pos and started to Swipe from right-left: positions are 2,1...why this happens? I need to catch the position of the imageURL to find out the ID of the specific image and so i need to download and set it as wallpaper.. Normally while we swipe from right-left,the positions should decrease like 4,3,2,1. Also in debugger mode i got some start position,end position,last position with different values.. Any Clue about ViewPager. Here is my code: public class ImagePagerActivity extends BaseActivity { private ViewPager pager; private DisplayImageOptions options; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_image_pager); Bundle bundle = getIntent().getExtras(); String[] imageUrls = bundle.getStringArray(Extra.IMAGES); int pagerPosition = bundle.getInt(Extra.IMAGE_POSITION, 0); options = new DisplayImageOptions.Builder() .showImageForEmptyUrl(R.drawable.image_for_empty_url) .cacheOnDisc() .decodingType(DecodingType.MEMORY_SAVING) .build(); pager = (ViewPager) findViewById(R.id.pager); pager.setAdapter(new ImagePagerAdapter(imageUrls)); pager.setCurrentItem(pagerPosition); } private class ImagePagerAdapter extends PagerAdapter { private String[] images; private LayoutInflater inflater; ImagePagerAdapter(String[] images) { this.images = images; inflater = getLayoutInflater(); } @Override public void destroyItem(View container, int position, Object object) { ((ViewPager) container).removeView((View) object); } @Override public void finishUpdate(View container) { } @Override public int getCount() { return images.length; } @Override public Object instantiateItem(View view, int position) { final FrameLayout imageLayout = (FrameLayout) inflater.inflate(R.layout.item_pager_image, null); final ImageView imageView = (ImageView) imageLayout.findViewById(R.id.image); final ProgressBar spinner = (ProgressBar) imageLayout.findViewById(R.id.loading); imageLoader.displayImage(images[position], imageView, options, new ImageLoadingListener() { public void onLoadingStarted() { spinner.setVisibility(View.VISIBLE); } public void onLoadingFailed() { spinner.setVisibility(View.GONE); imageView.setImageResource(android.R.drawable.ic_delete); } public void onLoadingComplete() { spinner.setVisibility(View.GONE); } }); ((ViewPager) view).addView(imageLayout, 0); return imageLayout; } @Override public boolean isViewFromObject(View view, Object object) { return view.equals(object); } @Override public void restoreState(Parcelable state, ClassLoader loader) { } @Override public Parcelable saveState() { return null; } @Override public void startUpdate(View container) { } } }

    Read the article

  • Android: Cannot cast from View to MapView

    - by Gaz
    I'm trying to run the Android MapView example, and am getting a 'Cannot cast from View to MapView' error in Eclipse. My layout is as follows <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainlayout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="0jwi0saLYCPGfO-t7glg5bQoBz7jVKWCcgyQWQA" /> <LinearLayout android:id="@+id/zoomview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@id/mapview" android:layout_centerHorizontal="true" /> </RelativeLayout> and the Activity code is package org.gaz.mapapp; import android.os.Bundle; import android.view.View; import android.widget.LinearLayout; import android.widget.ZoomControls; import com.google.android.maps.*; public class MapView extends MapActivity { LinearLayout linearLayout; MapView mapView; ZoomControls mZoom; public void onCreate(Bundle savedInstance) { linearLayout = (LinearLayout) findViewById(R.id.mainlayout); mapView = (MapView) findViewById(R.id.mapview); mZoom = (ZoomControls) mapView.getZoomControls(); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } } The error is caused by the line mapView = (MapView) findViewById(R.id.mapview); Can anybody offer an suggestions as to a fix? Cheers, Gaz.

    Read the article

  • Conversion to Dalvik format failed error for Android Grid View

    - by Bub
    Hey Everyone, I'm on the android bandwagon and started going through google's "view" tutorials. Here is what I'm using: Eclipse Galileo Android SDK 2.1 Java SDK 6.Something I think. Everything was hunky-dory until I hit the grid view tutorial. I got errors all over the place when I started editing the "HelloGridview.java" File. I thought I'd fix it by following through with the next part of the tutorial, creating the ImageAdapter class, but it created more. I realized alot of my issues could be resolved by importing widgets which were not mentioned in the tutorial (i.e. android.widget.GridView, .ImageView, .BaseAdapter etc.) However, after all the reconciliation suggested by eclipse the files were finally showing no errors. I go to run it as an android app and bam, "Your project contains error(s)." window comes up. There are no errors showing on the files I've created. I cleared the error log and shut down eclipse and started again the error log now reads: Conversion to Dalvik format failed with error 1. I'm a little lost at this point. I think I've included the required information. If you need to know more let me know. Any help is appreciated.

    Read the article

  • how to make the user add and delete in android

    - by user3678019
    i have 1 activity .. and in this activity i have 2 web view next to each other , i would like to add , ADD and Delete Button that can add one more web view next to the last web view , and the delete wish will delete any of the web view the user choose . and i want to make the user but it in the order he want like webview 1 first then webview 2 second how can i do this this is mu main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="test.zezo.test.Main$PlaceholderFragment" > <HorizontalScrollView android:id="@+id/horizontalScrollView2" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:layout_alignParentTop="true" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <WebView android:id="@+id/webView1" android:layout_width="350dp" android:layout_height="match_parent" android:layout_alignParentLeft="true" /> <WebView android:id="@+id/webView22" android:layout_width="350dp" android:layout_height="match_parent" android:layout_toRightOf="@+id/webView1" android:layout_alignParentLeft="true" /> </LinearLayout> </HorizontalScrollView> and this is a part of my main.java webView = (WebView) findViewById(R.id.webView1); String url = "http://google.com"; webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl(url); webView.setWebChromeClient(new WebChromeClient()); webView.setWebViewClient(new WebViewClient()); WebView webView22 = (WebView)findViewById(R.id.webView22); webView22.getSettings().setJavaScriptEnabled(true); webView22.loadUrl("google.com); webView22.setWebChromeClient(new WebChromeClient()); webView22.setWebViewClient(new WebViewClient()); so how can i do the ADD and DELETE and re Order Buttons to it and one more thing it should be save so when he reopen the app it will be the same as after he add or delete or re order

    Read the article

  • Android - Can display a single Activity using two layout.xml files?

    - by Avadhani
    I had developed Android app having some screens with common UI format. The format in top-down approach is: Title Header (Two buttons, ImageView) Content Area- It will differ among Activities (contains ListView, Tabs, Buttons, TextView, WebView....) Footer Layout (Relative Layout with three Imagebuttons) I want to reformat the code in such a way that one xml contains Title Header and Footer Layout and other xml contains ListView,Tabs, Buttons.. based on the usage. Can i acheive this? Please help me with sample code/links....

    Read the article

  • Copy android.R.layout to my project

    - by eric
    Good advice from CommonWare and Steve H but it's not as easy to me as I first thought. Based on their advice I'm trying to copy android.R.layout to my project to ensure consistency. How do you do this? I looked in Eclipse's Package Explorer and under Android 1.5android.jarandroidR.classRlayout and find R$layout.class. Do I copy the code out of there into my own class? From my very limited knowledge of Java, the following code doesn't make much sense: public static final class android.R$layout { // Field descriptor #8 I public static final int activity_list_item = 17367040; // Field descriptor #8 I public static final int browser_link_context_header = 17367054; // Field descriptor #8 I public static final int expandable_list_content = 17367041; // Field descriptor #8 I public static final int preference_category = 17367042; // Field descriptor #8 I public static final int select_dialog_item = 17367057; // Field descriptor #8 I public static final int select_dialog_multichoice = 17367059; // Field descriptor #8 I public static final int select_dialog_singlechoice = 17367058; // Field descriptor #8 I public static final int simple_dropdown_item_1line = 17367050; // Field descriptor #8 I public static final int simple_expandable_list_item_1 = 17367046; // Field descriptor #8 I public static final int simple_expandable_list_item_2 = 17367047; // Field descriptor #8 I public static final int simple_gallery_item = 17367051; // Field descriptor #8 I public static final int simple_list_item_1 = 17367043; // Field descriptor #8 I public static final int simple_list_item_2 = 17367044; // Field descriptor #8 I public static final int simple_list_item_checked = 17367045; // Field descriptor #8 I public static final int simple_list_item_multiple_choice = 17367056; // Field descriptor #8 I public static final int simple_list_item_single_choice = 17367055; // Field descriptor #8 I public static final int simple_spinner_dropdown_item = 17367049; // Field descriptor #8 I public static final int simple_spinner_item = 17367048; // Field descriptor #8 I public static final int test_list_item = 17367052; // Field descriptor #8 I public static final int two_line_list_item = 17367053; // Method descriptor #50 ()V // Stack: 3, Locals: 1 public R$layout(); 0 aload_0 [this] 1 invokespecial java.lang.Object() [1] 4 new java.lang.RuntimeException [2] 7 dup 8 ldc <String "Stub!"> [3] 10 invokespecial java.lang.RuntimeException(java.lang.String) [4] 13 athrow Line numbers: [pc: 0, line: 899] Local variable table: [pc: 0, pc: 14] local: this index: 0 type: android.R.layout Inner classes: [inner class info: #5 android/R$layout, outer class info: #64 android/R inner name: #55 layout, accessflags: 25 public static final] }

    Read the article

  • How to kill android application using android code?

    - by Natarajan M
    I am develoing small android application in eclipse. In that project i kill the running process in android, i got the Permission Denial error. how can i solve this problem in android. Anybody help for this problem.... THIS IS MY CODE package com.example.nuts; import java.util.Iterator; import java.util.List; import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityManager.RunningAppProcessInfo; import android.content.Context; import android.content.pm.PackageManager; import android.os.Bundle; import android.telephony.SmsManager; import android.widget.Toast; import android.*; public class killprocess extends Activity { SmsManager smsManager = SmsManager.getDefault(); Recivesms rms=new Recivesms(); String Number=""; int pid=0; String appname=""; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { Number=Recivesms.senderNum; pid=Integer.parseInt(Recivesms.struid); appname=getAppName(pid); Toast.makeText(getBaseContext(),"App Name is "+appname, Toast.LENGTH_LONG).show(); ActivityManager am = (ActivityManager) getSystemService(Activity.ACTIVITY_SERVICE); List<RunningAppProcessInfo> processes = am.getRunningAppProcesses(); if (processes != null){ for (int i=0; i<processes.size(); i++){ RunningAppProcessInfo temp = processes.get(i); String pName = temp.processName; if (pName.equals(appname)) { Toast.makeText(getBaseContext(),"App Name is matched "+appname+" "+pName, Toast.LENGTH_LONG).show(); int pid1 = android.os.Process.getUidForName(pName); //android.os.Process.killProcess(pid1); am.killBackgroundProcesses(pName); Toast.makeText(getBaseContext(), "Killed successfully....", Toast.LENGTH_LONG).show(); } } } smsManager.sendTextMessage(Number, null,"Your process Successfully killed..." , null,null); }catch(Exception e) { Toast.makeText(getBaseContext(),e.getMessage(), Toast.LENGTH_LONG).show(); } } private String getAppName(int Pid) { String processName = ""; ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE); List l = am.getRunningAppProcesses(); Iterator i = l.iterator(); PackageManager pm = this.getPackageManager(); while(i.hasNext()) { ActivityManager.RunningAppProcessInfo info = (ActivityManager.RunningAppProcessInfo)(i.next()); try { if(info.pid == Pid) { CharSequence c = pm.getApplicationLabel(pm.getApplicationInfo(info.processName, PackageManager.GET_META_DATA)); //Log.d("Process", "Id: "+ info.pid +" ProcessName: "+ info.processName +" Label: "+c.toString()); //processName = c.toString(); processName = info.processName; } } catch(Exception e) { //Log.d("Process", "Error>> :"+ e.toString()); } } return processName; } } After executing the code. i got the following error... Permission Denial: killBackgroundProcess() from pid=894, uid=10052 requires android.permission.KILL_BACKGROUND_PROCESSES Also i put the following line on manifest file <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESS" /> Anybody help for how to solve this problem... Thanking you....

    Read the article

  • What are the best strategies for selling Android apps?

    - by Rob S.
    I'm a young developer hoping to sell my apps I made for Android soon. My applications are basically 99% finished so I'm investigating what would be the best marketing strategy to use to sell my apps. I'm sure the brilliant minds here can give me some great advice. I'm particularly interested in your thoughts on the following points (especially from experienced Android developers): Is it more profitable to sell an app for free with ads or to sell an app without ads for a price? Perhaps a combination of a free ad version and a paid ad-free version? If you give away an app for free with ads on it is it ethical to decline bending over backwards to support it? How much does piracy actually affect potential sales? Should any effort be put towards preventing it? Can you still make a profit off your application if you make it open source? Could you perhaps make more of a profit from the attention you would get by doing so? Is Google's Android Marketplace really the best place to release Android apps? It is worthwhile enough to maintain a developer blog or website to keep users updated on your development progress and software releases? Any other suggestions you could give me to maximize profit meanwhile keeping users happy and coming back for more would also be greatly appreciated. While I appreciate general tips and tricks, I'd like to ask that if possible you please go the extra step and show how they specifically apply to selling Android apps. Marketing statistics, developer retrospect, and any additional experience you can share from your time selling Android apps is what I would love to see most. Thank you very much in advance for your time. I truly appreciate all the responses I receive.

    Read the article

  • Error while opening the Eclipse Android Layout Editor

    - by Janusz
    Since yesterday everytime I open my layout Editor in Eclipse for the Android UI I get the following exception: Unhandled event loop exception java.lang.StackOverflowError at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.isTheme(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.isTheme(Unknown Source) at... the last part goes on and on as expected if an Stackoverflow Exception occurs. Anybody else experiencing this and found a solution? I'm working with the latests android sdk on Mac OS X with Eclipse 3.5.2

    Read the article

  • Error when starting a tab activity in Android?

    - by ATDeveloper
    I followed the directions verbatim in this Android tutorial, copying/pasting the code from the site to my app. http://developer.android.com/resources/tutorials/views/hello-tabwidget.html However, when I try to run in the Android emulator, I get the error: "The application Hello Tab Widget has stopped unexpectedly. Please try again." I tried debugging by introducing a breakpoint in the first line of the onCreate method, but the error occurs before the breakpoint is even hit. Any idea of what is going wrong, or any other way I can debug this issue? I am using Eclipse.

    Read the article

  • Problem Building dschaefer / android-box2d

    - by Qwark
    I'm trying to build dschaefer android-box2d, and did follow the recipe. I do get this error when trying to build the TestBox2d with eclipse: make all /cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ld \ -nostdlib -shared -Bsymbolic --no-undefined \ -o obj/libtest.so obj/test.o -L../box2d/lib/android -lbox2d \ -L/cygdrive/c/android/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib \ -llog -lc -lstdc++ -lm \ /cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a \ /cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ld: cannot find -lbox2d make: * [obj/libtest.so] Error 1 The only thing I did change was in the TestBox2d\Makefile where i did change the path to the NDK. There are some other that have the same problem HERE but I do not know how to fix it.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >