Search Results

Search found 17553 results on 703 pages for 'android sdk'.

Page 20/703 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Android - Custom Widget doesnt update

    - by david
    Hi, I'm trying to make a widget to my app, but it doesnt update. I just need to change the textview text and open an activity when a press a button, but none of them works... the code public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.newswidget); views.setTextViewText(R.id.tvNews, "prueba1"); views.setString(R.id.tvNews, "setText", "prueba3"); Intent intent = new Intent(context, DoctorChatAndroid.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.ibNext, pendingIntent); for (int i = 0; i < appWidgetIds.length; i++) { appWidgetManager.updateAppWidget(i, views); } the layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageButton android:id="@+id/ibNext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_media_ff" android:layout_alignParentRight="true"/> <ImageButton android:id="@+id/ibLast" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_media_rew" android:layout_toLeftOf="@id/ibNext"/> <TextView android:id="@+id/tvNews" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/nwNoNewAnswer" android:layout_toLeftOf="@id/ibLast"/> </RelativeLayout> the other xml thx a lot!!!

    Read the article

  • Android: Strange out of memory issue

    - by Chrispix
    I am not sure where to start to explain this one. I have a list view with a couple image buttons on each row. When you click the list row, it launches a new activity. If you review some of my other posts, I have had to build my own tabs because of an issue w/ the camera layout. The activity that gets launched for result is a map. If I click on my button to launch the image preview (load an image off the sd card) the application returns from the activity back to the listview activity to the result handler to relaunch my new activity which is nothing more than an image widget. So here is the issue, the image preview on the list view is being done w/ the cursor & listadapter. This makes it pretty simple, but I am not sure how I can put a resized (i.e. smaller bit size not pixel) image as the src for the imgbutton on the fly. So I just resized the image that came off the phone camera. The issue is that I get an out of memory error when it tries to go back and re-launch the 2nd activity. ** My question : is there a way I can build the list adapter easily row by row, where I can resize on the fly (bit wise)? - this would be preferable as I also need to make some changes to the properties of the widgets/elements in each row as I am unable to select a row w/ touch screen b/c of focus issue. (I can use roller ball). ** I know I can do an out of band resize and save of my image, but that is not really what I want to do, but some sample code for that would be nice if that is your suggestion. As soon as I disabled the image on the listview it worked fine again. FYI : This is how I was doing it : String[] from = new String[] { DBHelper.KEY_BUSINESSNAME, DBHelper.KEY_ADDRESS, DBHelper.KEY_CITY, DBHelper.KEY_GPSLONG, DBHelper.KEY_GPSLAT, DBHelper.KEY_IMAGEFILENAME + ""}; to = new int[] { R.id.businessname, R.id.address, R.id.city, R.id.gpslong, R.id.gpslat, R.id.imagefilename }; notes = new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to); setListAdapter(notes); Where R.id.imagefilename is a ButtonImage Here is my LogCat 01-25 05:05:49.877: ERROR/dalvikvm-heap(3896): 6291456-byte external allocation too large for this process. 01-25 05:05:49.877: ERROR/(3896): VM won't let us allocate 6291456 bytes 01-25 05:05:49.877: ERROR/AndroidRuntime(3896): Uncaught handler: thread main exiting due to uncaught exception 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:304) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:149) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:174) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.graphics.drawable.Drawable.createFromPath(Drawable.java:729) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.ImageView.resolveUri(ImageView.java:484) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.ImageView.setImageURI(ImageView.java:281) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.SimpleCursorAdapter.setViewImage(SimpleCursorAdapter.java:183) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.SimpleCursorAdapter.bindView(SimpleCursorAdapter.java:129) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.CursorAdapter.getView(CursorAdapter.java:150) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.AbsListView.obtainView(AbsListView.java:1057) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.ListView.makeAndAddView(ListView.java:1616) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.ListView.fillSpecific(ListView.java:1177) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.ListView.layoutChildren(ListView.java:1454) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.AbsListView.onLayout(AbsListView.java:937) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.view.View.layout(View.java:5611) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.LinearLayout.onLayout(LinearLayout.java:922) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.view.View.layout(View.java:5611) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.FrameLayout.onLayout(FrameLayout.java:294) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.view.View.layout(View.java:5611) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:999) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.LinearLayout.onLayout(LinearLayout.java:920) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.view.View.layout(View.java:5611) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.widget.FrameLayout.onLayout(FrameLayout.java:294) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.view.View.layout(View.java:5611) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.view.ViewRoot.performTraversals(ViewRoot.java:771) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.view.ViewRoot.handleMessage(ViewRoot.java:1103) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.os.Handler.dispatchMessage(Handler.java:88) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.os.Looper.loop(Looper.java:123) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at android.app.ActivityThread.main(ActivityThread.java:3742) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at java.lang.reflect.Method.invokeNative(Native Method) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at java.lang.reflect.Method.invoke(Method.java:515) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497) 01-25 05:05:49.917: ERROR/AndroidRuntime(3896): at dalvik.system.NativeStart.main(Native Method) 01-25 05:10:01.127: ERROR/AndroidRuntime(3943): ERROR: thread attach failed I also have a new error when displaying an image : 01-25 22:13:18.594: DEBUG/skia(4204): xxxxxxxxxxx jpeg error 20 Improper call to JPEG library in state %d 01-25 22:13:18.604: INFO/System.out(4204): resolveUri failed on bad bitmap uri: 01-25 22:13:18.694: ERROR/dalvikvm-heap(4204): 6291456-byte external allocation too large for this process. 01-25 22:13:18.694: ERROR/(4204): VM won't let us allocate 6291456 bytes 01-25 22:13:18.694: DEBUG/skia(4204): xxxxxxxxxxxxxxxxxxxx allocPixelRef failed

    Read the article

  • CastClassException on Custom View

    - by tuxGurl
    When I try to findViewById() on my custom view I keep getting a ClassCastException. I've tried so many things that I'm sure I've botched the code now! To make sure I'm not going insane I stripped down the classes to their bare minimum inorder to find what was wrong. I'm new to android programming and I'm sure I'm missing something basic. This is BaseImageView an extended view class. package com.company.product.client.android.gui.views; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.view.View; public class BaseImageView extends View { public BaseImageView(Context context) { super(context); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawColor(Color.GREEN); } } This is LiveImageView an extension of the BaseImageView class. package com.company.product.client.android.gui.views; import android.content.Context; import android.util.AttributeSet; public class LiveImageView extends BaseImageView { public LiveImageView(Context context, AttributeSet attrs) { super(context); } } Here is the Layout my_view.xml. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center"> <View class="com.company.product.client.android.gui.views.LiveImageView" android:id="@+id/lvImage" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> And here is the onCreate in my Activity LiveViewActivity. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { setContentView(R.layout.my_view); final LiveImageView lvImage = (LiveImageView) findViewById(R.id.lvImage); } catch (final Exception e) { Log.e(TAG, "onCreate() Exception: " + e.toString()); e.printStackTrace(); } Finally, this is stack trace. 02-11 17:25:24.829: ERROR/LiveViewActivity(1942): onCreate() Exception: java.lang.ClassCastException: android.view.View 02-11 17:25:24.839: WARN/System.err(1942): java.lang.ClassCastException: android.view.View 02-11 17:25:24.839: WARN/System.err(1942): at com.company.product.client.android.gui.screen.LiveViewActivity.onCreate(LiveViewActivity.java:26) 02-11 17:25:24.839: WARN/System.err(1942): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 02-11 17:25:24.859: WARN/System.err(1942): at android.os.Handler.dispatchMessage(Handler.java:99) 02-11 17:25:24.859: WARN/System.err(1942): at android.os.Looper.loop(Looper.java:123) 02-11 17:25:24.859: WARN/System.err(1942): at android.app.ActivityThread.main(ActivityThread.java:4363) 02-11 17:25:24.869: WARN/System.err(1942): at java.lang.reflect.Method.invokeNative(Native Method) 02-11 17:25:24.869: WARN/System.err(1942): at java.lang.reflect.Method.invoke(Method.java:521) 02-11 17:25:24.869: WARN/System.err(1942): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 02-11 17:25:24.869: WARN/System.err(1942): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 02-11 17:25:24.879: WARN/System.err(1942): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • RadioGroup onCheckedChanged function won't fire

    - by user1758088
    First time/long time. My app keeps track of restaurant servers' shift sales to help them budget. In the activity that displays past shifts, I've created a RadioGroup under the ListView so the server can choose lunch, dinner, or both. I've implemented RadioGroup.onCheckedChangeListener, but onCheckChanged never gets called. I also tried an anonymous inner class as listener, same result. I tried to copy/modify code from this answer: http://stackoverflow.com/a/9595528 ...but when I added the @Override to the callback function, the Eclipse compiler gave me an error (not warning) that the method must override a superclass, and the quick fix was to remove the override. I'm pretty sure the signatures are correct, as they were made with Eclipse's autocomplete and implement methods facilities. I then followed instructions to move my java compiler from 1.5 to 1.6, and none of the above listed behavior seemed to change. Here's the code I thing is relavent: public class DataActivity extends ListActivity implements OnCheckedChangeListener{ RadioButton rbBoth; RadioButton rbDinnerOnly; RadioButton rbLunchOnly; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.database); ... final RadioGroup rgGroup = (RadioGroup)findViewById(R.id.DataRadioGroup); rbBoth = (RadioButton)findViewById(R.id.RadioBoth); rbDinnerOnly = (RadioButton)findViewById(R.id.RadioDinnerOnly); rbLunchOnly = (RadioButton)findViewById(R.id.RadioLunchOnly); rgGroup.setOnCheckedChangeListener(this); populateAllShifts(); } ... public void onCheckedChanged(RadioGroup group, int checkedId) { rbLunchOnly.setText("Click!"); Toast.makeText(getApplicationContext(), "Lunch Only", Toast.LENGTH_LONG).show(); if(group.getCheckedRadioButtonId() == R.id.RadioBoth){ populateAllShifts(); return; } if(group.getCheckedRadioButtonId() == R.id.RadioLunchOnly){ populatLunchShifts(); return; } if(group.getCheckedRadioButtonId() == R.id.RadioDinnerOnly){ populateDinnerShifts(); return; } } There is a ListView in this class with a custom adapter, but if my understanding and my XML are correct, the RadioGroup should be outside of the list: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/llDataLayout" android:weightSum="5" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <ListView android:layout_weight="4" android:layout_width="fill_parent" android:id="@android:id/list" android:layout_height="wrap_content"></ListView> <RadioGroup android:layout_weight="1" android:id="@+id/DataRadioGroup" android:orientation="horizontal" android:layout_height="wrap_content" android:layout_width="fill_parent"> <RadioButton android:text="Lunch and Dinner" android:textSize="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/RadioBoth"/> <RadioButton android:text="Dinner Only" android:textSize="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/RadioDinnerOnly"/> <RadioButton android:text="Lunch Only" android:textSize="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/RadioLunchOnly"/> </RadioGroup> </LinearLayout> Any ideas out there?

    Read the article

  • Detecting cause of RuntimeException: Unable to stop activity

    - by Pentium10
    I have a really weird error, and I don't know what is causing this. It happens when I leave the Activity. 05-16 12:26:20.360: ERROR/AndroidRuntime(11648): Uncaught handler: thread main exiting due to uncaught exception 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): java.lang.RuntimeException: Unable to stop activity {com.myapk/com.myapk.modules.viewPairing}: java.lang.NullPointerException 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3596) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3674) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.app.ActivityThread.access$2800(ActivityThread.java:126) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1965) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.os.Handler.dispatchMessage(Handler.java:99) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.os.Looper.loop(Looper.java:123) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.app.ActivityThread.main(ActivityThread.java:4595) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at java.lang.reflect.Method.invokeNative(Native Method) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at java.lang.reflect.Method.invoke(Method.java:521) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at dalvik.system.NativeStart.main(Native Method) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): Caused by: java.lang.NullPointerException 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.app.Activity.performStop(Activity.java:3848) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3591) 05-16 12:26:20.400: ERROR/AndroidRuntime(11648): ... 11 more

    Read the article

  • Spinner cannot load an integer array?

    - by Adam
    I have an application, which has a Spinner that I want populated with some numbers (4,8,12,16). I created an integer-array object in strings.xml with the items mentioned above, set the entries of the Spinner to the integer-array, and when I run the app I get: 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): java.lang.NullPointerException 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.AbsSpinner.onMeasure(AbsSpinner.java:198) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.View.measure(View.java:7965) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.LinearLayout.measureVertical(LinearLayout.java:350) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.LinearLayout.onMeasure(LinearLayout.java:278) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.View.measure(View.java:7965) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.View.measure(View.java:7965) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.LinearLayout.measureVertical(LinearLayout.java:464) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.LinearLayout.onMeasure(LinearLayout.java:278) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.View.measure(View.java:7965) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.View.measure(View.java:7965) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.ViewRoot.performTraversals(ViewRoot.java:763) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.view.ViewRoot.handleMessage(ViewRoot.java:1632) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.os.Handler.dispatchMessage(Handler.java:99) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.os.Looper.loop(Looper.java:123) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.app.ActivityThread.main(ActivityThread.java:4310) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at java.lang.reflect.Method.invokeNative(Native Method) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at java.lang.reflect.Method.invoke(Method.java:521) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at dalvik.system.NativeStart.main(Native Method) As soon as I changed the array to a string-array, this works fine. Is this normal? I realize that I can (and will) just convert the string array values to an int, but it seems weird that I have to. Thanks!

    Read the article

  • Android popup style activity which sits on top of any other apps

    - by RenegadeAndy
    What I want to create is a popup style application. I have a service in the background - something arrives on the queue and i want an activity to start to inform the user - very very similar to the functionality of SMSPopup app. So I have the code where something arrives on the queue and it calls my activity. However for some reason the activity always shows on top of the originally started activity instead of just appearing on the main desktop of the android device. As an example: I have the main activity which is shown when the application is run I have the service which checks queue I have a popup activity. When i start the main activity it starts the service - I can now close this. I then have something on the queue and it creates the popup activity which launches the main activity with the popup on top of it :S How do I stop this and have it behave as i want... The popup class is : package com.andy.tabletsms.work; import com.andy.tabletsms.tablet.R; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; import android.widget.PopupWindow; import android.widget.TextView; import android.widget.Toast; public class SMSPopup extends Activity implements OnClickListener{ public static String msg; @Override public void onCreate(Bundle bundle){ super.onCreate(bundle); // Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show(); this.setContentView(R.layout.popup); TextView tv = (TextView)findViewById(R.id.txtLbl); Intent intent = getIntent(); if (intent != null){ Bundle bb = intent.getExtras(); if (bb != null){ msg = bb.getString("com.andy.tabletsms.message"); } } if(msg == null){ msg = "LOLOLOL"; } tv.setText(msg); Button b = (Button)findViewById(R.id.closeBtn); b.setOnClickListener(this); } @Override public void onClick(View v) { this.finish(); } } and I call the activity from a broadcast receiver which checks the queue every 30 seconds or so : if(main.msgs.size()0){ Intent testActivityIntent = new Intent(context.getApplicationContext(), com.andy.tabletsms.work.SMSPopup.class); testActivityIntent.putExtra("com.andy.tabletsms.message", main.msgs.get(0)); testActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(testActivityIntent); } The layout is here : http://pastebin.com/F25u6wdM

    Read the article

  • Trying to setup android sdk on PC with windows XP

    - by John Donovan
    When I start setup I get this message: XML verification failed for http://dl-ssl.google.com/android/repository/repository.xml. Error: cvc-elt.1: Cannot find the declaration of element 'sdk:sdk-repository'. Failed to fetch URL reason: Unknown Even when I force the download to use http nothing happens. I get no downloads etc for the SDK. Any help would be greatly appreciated.

    Read the article

  • How to get real-time status notification with Facebook SDK via listener

    - by Mathias Lin
    I'm using Twitter4j and the Android Facebook SDK to fetch status messages. With Twitter4J I get real-time notifications whenever a new status has been added to the stream via StatusListener (Twitter4J). In the Facebook SDK I cannot find a similar way, I can only fetch entire streams over and over again in a fixed time interval using RequestListener (Facebook SDK) as far as I see it. Is there any way to get notified of new statuses in realtime with the Facebook SDK in a similar way as with Twitter4J? (Found a similar but unanswered question here: Facebook real-time updated application wall)

    Read the article

  • Android manifest

    - by Venkatesh
    hi friends, I am having two package in my application 1.com.fsp.deals and 2.com.facebook.android.. i declared my package as package =com.fsp.deals in Manifest file.. if i want to use the activity in com.facebook.android how i should call activity in manifest file it showing error as i define as </activity> <activity android:name="com.facebook.android.Example" android:screenOrientation="portrait" android:label="@string/app_name" android:windowSoftInputMode="stateUnspecified|adjustPan"> </activity>

    Read the article

  • How to install older Android SDK in Eclipse

    - by John Brunner
    I'm working at the moment at a simple app in eclipse for android. Just receiving and sending data, and using the camera API. I've set the minSDKversion to 8, because I think that has the widest user base. But at the beginning of the project eclipse was asking me which target SDK version I would use, and because I had just one installed (the latest 4.0.3) I've took this. Now I'm asking me if it wouldn't be wiser to install a lower SDK, like Android 2.2, because it would be not that big (compared to the 4.0.3) and my app would not have included all the fancy new features, which are not used in any way?! Or is this complete nonsense I'm talking here, and just should take my 4.0.3 SDK? When not, how can I install a lower version? Help -> SDK Manager is not showing old SDKs...

    Read the article

  • Looking for android Facebook SDK examples...

    - by brybam
    I've looked all over the internet and can't seem to find what i'm looking for... I'm just trying to find a site with some examples on how to use the OFFICIAL facebook android SDK http://github.com/facebook/facebook-android-sdk To be specific i'd like to see some examples on notification use and simple photo upload. But i'll take anything to help get a feel for using the SDK. If anyone knows of any examples please share thank you so much!

    Read the article

  • How to clear all activity in android?

    - by Sushant
    I have one main activity "Dashboard" with a action bar containing home screen icon and exit button , i go to activity A -activity B -activity C from dashboard screen . Now on C, i click on action bar dashboard icon which bring to me on Dashboard screen . Now i go to activity E -activity G-activity H from dashboard screen . From H i press exit button , it come to C screen . When again click on exit i go through me out of application. Why there is need to press 2 times exit button for exit application . On Home Screen Icon :- public void onClickHome(View view){ final Intent intent = new Intent(getBaseContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); getBaseContext().startActivity(intent); //goDashboard(); } ON exit button :- AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle(getString(R.string.logoutDialogTitle)); alert.setMessage(getString(R.string.logoutDialogMessage)); final OnlineBookApp app = (OnlineBookApp) getApplicationContext(); alert.setPositiveButton(getString(R.string.logoutDialogCancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { } }); alert.setNegativeButton(getString(R.string.logoutDialogOk), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { //finish(); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); // // moveTaskToBack(true); //// stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); // System.runFinalizersOnExit(true); // android.os.Process.killProcess(android.os.Process.myPid()); //moveTaskToBack(true); // finish(); // app.SetIsExit(true); Intent intent = new Intent(getApplicationContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra("EXIT", true); startActivity(intent); } }); alert.setNeutralButton(getString(R.string.logoutDialogLogout), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { //finish(); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); //finish(); //app.SetIsExit(true); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); app.logout(); Intent intent = new Intent(getApplicationContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra("EXIT", true); startActivity(intent); } }); alert.show();

    Read the article

  • add android support library v4 to intellij ide

    - by user1233587
    i am trying to use viewpager from android support library v4 in intelli j currently i have android sdk 4.1 I copied android-support-v4.jar to my intellij android project under 'libs' in the project settings of intellij I webt to "Modules" = "MyModuleName" = dependencies tab, and add the android-support-v4.jar, by navigating the path to the libs/ folder under my own project I checked the 'export' besides this newly added jar file but i still can't use viewpager in my application i get a crash msg like java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxxx/com.xxxx.MyActivity}: android.view.InflateException: Binary XML file line #13: Error inflating class android.support.v4.view.ViewPager

    Read the article

  • Multiple dex files define Lcom/google/api/client/auth/oauth/AbstractOAuthGetToken;

    - by Elad Benda
    I have just followed this tutorial: https://developers.google.com/drive/quickstart-android so I don't see a reason for duplicated libs in my project. I have added the drive Client lib via Google plugin for eclipse When I build my android app with this manifest <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="16" /> <uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.INTERNET" /> <application android:icon="@drawable/todo" android:label="@string/app_name" > <activity android:name=".TodosOverviewActivity" 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=".TodoDetailActivity" android:windowSoftInputMode="stateVisible|adjustResize" > <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter> </activity> <provider android:name=".contentprovider.MyTodoContentProvider" android:authorities="de.vogella.android.todos.contentprovider" > </provider> </application> I get the following error: [2013-10-27 00:43:58 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/api/client/auth/oauth/AbstractOAuthGetToken; [2013-10-27 00:43:58 - de.vogella.android.todos] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/api/client/auth/oauth/AbstractOAuthGetToken; how can I fix this?

    Read the article

  • Spinner activity not working

    - by user1696863
    I'm trying to create an activity, RateCardActivity, which has a spinner in it. My layout file for RateCardActivity is rate_card. My RateCardActivity looks like the following. public class RateCardActivity { public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.rate_card); Spinner spinner = (Spinner) findViewById(R.id.select_city); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.select_city, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); } } The layout file rate_card is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:custom="http://schemas.android.com/apk/res/com.olacabs.customer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:color/darker_gray" android:gravity="center" android:paddingBottom="4dp" android:paddingTop="4dp" android:text="@string/rate_card" android:textColor="@color/white" android:textSize="20dp" custom:customFont="litera_bold.ttf" /> <Spinner android:id="@+id/select_city" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> The RateCardActivity is called from another activity using an intent (I'm sure there is nothing wrong with that part of the code as when I substitute RateCardActivity with another activity, the application works fine). When I try to open the RateCardActivity in the application in emulator, the application crashes and I got the message "The application has stopped unexpectedly. Please try again later." I can't seem to understand what I'm doing wrong, and want to know how to correct this?

    Read the article

  • multiple screen support

    - by pedr0
    Hi at all, I have some problem with multiple screen support, I work with dp(dpi) for specify the layout_heigth and layout_width and I hope that is the better way to support multiple screen, but when I tried with two smartphone I meet two different result. I give an example, this is a layout I use: <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/cities_main_layout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:id="@+id/citieslist" android:layout_width="wrap_content" android:layout_height="320dip" android:layout_gravity="center_vertical" android:layout_below="@id/cities_main_layout" /> <LinearLayout android:id="@+id/cities_button_layout" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/citieslist" android:layout_gravity="center_vertical"> <Button android:id="@+id/bycountry" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_bycountry" /> <Button android:id="@+id/top10" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_top10" /> <Button android:id="@+id/recommended" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_recommended" /> </LinearLayout> </RelativeLayout> The button are at the bottom of the layout, and I see two different result: In the last smartphone I can see the buttons, instead in the first I cannot...what's wrong? I have to write a layout for any set of screen??!!!

    Read the article

  • Installation error: INSTALL_FAILED_OLDER_SDK in eclipse

    - by user3014909
    I have an unexpe`ted problem with my Android project. I have a real android device with ice_cream sandwich installed. My app was working fine during the development but after I added a class to the project, I got an error: Installation error: INSTALL_FAILED_OLDER_SDK The problem is that everything is good in the manifest file. The minSdkversion is 8. Here is my manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="zabolotnii.pavel.timer" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18 " /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="zabolotnii.pavel.timer.TimerActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> I don't know, if there is any need to attach the new class ,but I didn't any changes to other code that should led to this error: package zabolotnii.pavel.timer; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Paint; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Environment; import android.util.DisplayMetrics; import android.util.TypedValue; import android.view.*; import android.widget.*; import java.io.File; import java.io.FilenameFilter; import java.util.*; public class OpenFileDialog extends AlertDialog.Builder { private String currentPath = Environment.getExternalStorageDirectory().getPath(); private List<File> files = new ArrayList<File>(); private TextView title; private ListView listView; private FilenameFilter filenameFilter; private int selectedIndex = -1; private OpenDialogListener listener; private Drawable folderIcon; private Drawable fileIcon; private String accessDeniedMessage; public interface OpenDialogListener { public void OnSelectedFile(String fileName); } private class FileAdapter extends ArrayAdapter<File> { public FileAdapter(Context context, List<File> files) { super(context, android.R.layout.simple_list_item_1, files); } @Override public View getView(int position, View convertView, ViewGroup parent) { TextView view = (TextView) super.getView(position, convertView, parent); File file = getItem(position); if (view != null) { view.setText(file.getName()); if (file.isDirectory()) { setDrawable(view, folderIcon); } else { setDrawable(view, fileIcon); if (selectedIndex == position) view.setBackgroundColor(getContext().getResources().getColor(android.R.color.holo_blue_dark)); else view.setBackgroundColor(getContext().getResources().getColor(android.R.color.transparent)); } } return view; } private void setDrawable(TextView view, Drawable drawable) { if (view != null) { if (drawable != null) { drawable.setBounds(0, 0, 60, 60); view.setCompoundDrawables(drawable, null, null, null); } else { view.setCompoundDrawables(null, null, null, null); } } } } public OpenFileDialog(Context context) { super(context); title = createTitle(context); changeTitle(); LinearLayout linearLayout = createMainLayout(context); linearLayout.addView(createBackItem(context)); listView = createListView(context); linearLayout.addView(listView); setCustomTitle(title) .setView(linearLayout) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (selectedIndex > -1 && listener != null) { listener.OnSelectedFile(listView.getItemAtPosition(selectedIndex).toString()); } } }) .setNegativeButton(android.R.string.cancel, null); } @Override public AlertDialog show() { files.addAll(getFiles(currentPath)); listView.setAdapter(new FileAdapter(getContext(), files)); return super.show(); } public OpenFileDialog setFilter(final String filter) { filenameFilter = new FilenameFilter() { @Override public boolean accept(File file, String fileName) { File tempFile = new File(String.format("%s/%s", file.getPath(), fileName)); if (tempFile.isFile()) return tempFile.getName().matches(filter); return true; } }; return this; } public OpenFileDialog setOpenDialogListener(OpenDialogListener listener) { this.listener = listener; return this; } public OpenFileDialog setFolderIcon(Drawable drawable) { this.folderIcon = drawable; return this; } public OpenFileDialog setFileIcon(Drawable drawable) { this.fileIcon = drawable; return this; } public OpenFileDialog setAccessDeniedMessage(String message) { this.accessDeniedMessage = message; return this; } private static Display getDefaultDisplay(Context context) { return ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); } private static Point getScreenSize(Context context) { Point screeSize = new Point(); getDefaultDisplay(context).getSize(screeSize); return screeSize; } private static int getLinearLayoutMinHeight(Context context) { return getScreenSize(context).y; } private LinearLayout createMainLayout(Context context) { LinearLayout linearLayout = new LinearLayout(context); linearLayout.setOrientation(LinearLayout.VERTICAL); linearLayout.setMinimumHeight(getLinearLayoutMinHeight(context)); return linearLayout; } private int getItemHeight(Context context) { TypedValue value = new TypedValue(); DisplayMetrics metrics = new DisplayMetrics(); context.getTheme().resolveAttribute(android.R.attr.listPreferredItemHeightSmall, value, true); getDefaultDisplay(context).getMetrics(metrics); return (int) TypedValue.complexToDimension(value.data, metrics); } private TextView createTextView(Context context, int style) { TextView textView = new TextView(context); textView.setTextAppearance(context, style); int itemHeight = getItemHeight(context); textView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, itemHeight)); textView.setMinHeight(itemHeight); textView.setGravity(Gravity.CENTER_VERTICAL); textView.setPadding(15, 0, 0, 0); return textView; } private TextView createTitle(Context context) { TextView textView = createTextView(context, android.R.style.TextAppearance_DeviceDefault_DialogWindowTitle); return textView; } private TextView createBackItem(Context context) { TextView textView = createTextView(context, android.R.style.TextAppearance_DeviceDefault_Small); Drawable drawable = getContext().getResources().getDrawable(android.R.drawable.ic_menu_directions); drawable.setBounds(0, 0, 60, 60); textView.setCompoundDrawables(drawable, null, null, null); textView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { File file = new File(currentPath); File parentDirectory = file.getParentFile(); if (parentDirectory != null) { currentPath = parentDirectory.getPath(); RebuildFiles(((FileAdapter) listView.getAdapter())); } } }); return textView; } public int getTextWidth(String text, Paint paint) { Rect bounds = new Rect(); paint.getTextBounds(text, 0, text.length(), bounds); return bounds.left + bounds.width() + 80; } private void changeTitle() { String titleText = currentPath; int screenWidth = getScreenSize(getContext()).x; int maxWidth = (int) (screenWidth * 0.99); if (getTextWidth(titleText, title.getPaint()) > maxWidth) { while (getTextWidth("..." + titleText, title.getPaint()) > maxWidth) { int start = titleText.indexOf("/", 2); if (start > 0) titleText = titleText.substring(start); else titleText = titleText.substring(2); } title.setText("..." + titleText); } else { title.setText(titleText); } } private List<File> getFiles(String directoryPath) { File directory = new File(directoryPath); List<File> fileList = Arrays.asList(directory.listFiles(filenameFilter)); Collections.sort(fileList, new Comparator<File>() { @Override public int compare(File file, File file2) { if (file.isDirectory() && file2.isFile()) return -1; else if (file.isFile() && file2.isDirectory()) return 1; else return file.getPath().compareTo(file2.getPath()); } }); return fileList; } private void RebuildFiles(ArrayAdapter<File> adapter) { try { List<File> fileList = getFiles(currentPath); files.clear(); selectedIndex = -1; files.addAll(fileList); adapter.notifyDataSetChanged(); changeTitle(); } catch (NullPointerException e) { String message = getContext().getResources().getString(android.R.string.unknownName); if (!accessDeniedMessage.equals("")) message = accessDeniedMessage; Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show(); } } private ListView createListView(Context context) { ListView listView = new ListView(context); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int index, long l) { final ArrayAdapter<File> adapter = (FileAdapter) adapterView.getAdapter(); File file = adapter.getItem(index); if (file.isDirectory()) { currentPath = file.getPath(); RebuildFiles(adapter); } else { if (index != selectedIndex) selectedIndex = index; else selectedIndex = -1; adapter.notifyDataSetChanged(); } } }); return listView; } }

    Read the article

  • Find package name for Android apps to use Intent to launch Market app from web

    - by eom
    I'm creating a mobile website that will include a page from which people can download relevant apps that we recommend. I've found instructions for creating the links to launch the Market but this assumes that you are the developer of the app in question and know the exact package name. Is there any way to get the package name, other than just contacting the developers and asking? Also, it turns out that those instructions don't really work for creating web hyperlinks. They only give you a URI to reference in a string of Java code in another Android app. Our site is in Drupal, so Java is not going to work. For the iPhone, I found easy instructions for getting the URL/link style I need from the iTunes store, so I'm looking for info like that.

    Read the article

  • [Android] Force close when trying to parse JSON with AsyncTask in the background

    - by robs
    Hello everyone, i'm new to android development and i'm playing around with json data. I managed to get the parsing to work. I want to show a ProgressDialog and i read that i need to use AsyncTask that. But for some reason i get a force close as soon as i put the same working code inside doInBackground() eventhough eclipse says everything is fine. Here is the source code: public class HomeActivity extends Activity { public class BackgroundAsyncTask extends AsyncTask<Void, Integer, Void> { ProgressDialog dialog = new ProgressDialog (HomeActivity.this); @Override protected void onPreExecute() { dialog.setMessage("Loading...please wait"); dialog.setIndeterminate(true); dialog.setCancelable(false); dialog.show(); } protected void onPostExecute() { dialog.dismiss(); } @Override protected Void doInBackground(Void... params) { try { URL json = new URL("http://www.corps-marchia.de/jsontest.php"); URLConnection tc = json.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(tc.getInputStream())); String line; while ((line = in.readLine()) != null) { JSONArray ja = new JSONArray(line); JSONObject jo = (JSONObject) ja.get(0); TextView txtView = (TextView)findViewById(R.id.TextView01); txtView.setText(jo.getString("text")); } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } return null; } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); new BackgroundAsyncTask().execute(); } } Here is the error log: 01-08 12:33:48.225: ERROR/AndroidRuntime(815): FATAL EXCEPTION: AsyncTask #1 01-08 12:33:48.225: ERROR/AndroidRuntime(815): java.lang.RuntimeException: An error occured while executing doInBackground() 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.os.AsyncTask$3.done(AsyncTask.java:200) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at java.util.concurrent.FutureTask.setException(FutureTask.java:125) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at java.util.concurrent.FutureTask.run(FutureTask.java:138) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at java.lang.Thread.run(Thread.java:1019) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.view.ViewRoot.checkThread(ViewRoot.java:2932) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.view.ViewRoot.requestLayout(ViewRoot.java:629) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.view.View.requestLayout(View.java:8267) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.view.View.requestLayout(View.java:8267) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.view.View.requestLayout(View.java:8267) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.view.View.requestLayout(View.java:8267) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.view.View.requestLayout(View.java:8267) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.widget.TextView.checkForRelayout(TextView.java:5521) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.widget.TextView.setText(TextView.java:2724) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.widget.TextView.setText(TextView.java:2592) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.widget.TextView.setText(TextView.java:2567) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at net.ajzele.demo.andy1.HomeActivity$BackgroundAsyncTask.doInBackground(HomeActivity.java:52) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at net.ajzele.demo.andy1.HomeActivity$BackgroundAsyncTask.doInBackground(HomeActivity.java:1) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at android.os.AsyncTask$2.call(AsyncTask.java:185) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306) 01-08 12:33:48.225: ERROR/AndroidRuntime(815): ... 4 more 01-08 12:33:51.605: ERROR/WindowManager(815): Activity net.ajzele.demo.andy1.HomeActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4051d0c0 that was originally added here 01-08 12:33:51.605: ERROR/WindowManager(815): android.view.WindowLeaked: Activity net.ajzele.demo.andy1.HomeActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4051d0c0 that was originally added here 01-08 12:33:51.605: ERROR/WindowManager(815): at android.view.ViewRoot.<init>(ViewRoot.java:258) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.view.Window$LocalWindowManager.addView(Window.java:424) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.app.Dialog.show(Dialog.java:241) 01-08 12:33:51.605: ERROR/WindowManager(815): at net.ajzele.demo.andy1.HomeActivity$BackgroundAsyncTask.onPreExecute(HomeActivity.java:33) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.os.AsyncTask.execute(AsyncTask.java:391) 01-08 12:33:51.605: ERROR/WindowManager(815): at net.ajzele.demo.andy1.HomeActivity.onCreate(HomeActivity.java:72) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.os.Handler.dispatchMessage(Handler.java:99) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.os.Looper.loop(Looper.java:123) 01-08 12:33:51.605: ERROR/WindowManager(815): at android.app.ActivityThread.main(ActivityThread.java:3647) 01-08 12:33:51.605: ERROR/WindowManager(815): at java.lang.reflect.Method.invokeNative(Native Method) 01-08 12:33:51.605: ERROR/WindowManager(815): at java.lang.reflect.Method.invoke(Method.java:507) 01-08 12:33:51.605: ERROR/WindowManager(815): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 01-08 12:33:51.605: ERROR/WindowManager(815): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 01-08 12:33:51.605: ERROR/WindowManager(815): at dalvik.system.NativeStart.main(Native Method) Any hints? I hope you can help me out ive searched the net and didnt find any working solution...Thanks in advance

    Read the article

  • Panel widget overlapping other contents in android

    - by walker
    I'm trying to utilize the Panel widget introduced in android-misc-widgets. It's been good so far. Now the problem is the sliding panel overlaps my top menu bar. For clarification look at the following screenshots. This is when I open panel using drag gesture (no problem here): This is when I open the panel with a single tap (look at the icons overlapping the top menu): There is one other problem, If there is any content inside the activity, opening the panel pushes that content out of the screen!

    Read the article

  • Android relative layout problem with gravity

    - by DixieFlatline
    How can i put textview with id="naslov" to the center? I also tried with layout_gravity="center" but that doesn't work either. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/naslov" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20dip" android:text="Povzetek" android:gravity="center"/> <TextView android:id="@+id/aha" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="10dip" android:text="Vseh oddaj:" android:layout_below="@id/naslov"/> </RelativeLayout>

    Read the article

  • Android Internet permission and Google Play filtering

    - by Ivan
    I added <uses-permission android:name="android.permission.INTERNET" /> to my manifest in order to have access to Internet, but this is not a main function of my app. So, I don't want to get filtered in Google Play because of this. There is no matching <uses-feature> for this, so my question is what do I need to add with required="false" to avoid filtering. I guess I could add <uses-feature android:name="android.hardware.wifi" android:required="false" /> but what about mobile Internet (3G/4G), do I also need this? <uses-feature android:name="android.hardware.telephony" android:required="false"/> I want to know which filtering android.permission.INTERNET adds on Google Play, if it adds something.

    Read the article

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