Search Results

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

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

  • Android: How to find the position clicked from the context menu

    - by Josemalive
    Hi, I have a list view filled with data. I set up a context menu for the listview using the following code: list.setOnCreateContextMenuListener ( new View.OnCreateContextMenuListener() { public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { AdapterContextMenuInfo mi =(AdapterContextMenuInfo) menuInfo; menu.add(0, 0, 0, "Delete item"); } } ); I have the following method override to control de contextmenu menuitem selected: @Override public boolean onContextItemSelected(MenuItem item) { switch(item.getItemId()) { case 0: ShowAlert("hello from delete item"); break; default: return super.onContextItemSelected(item); } return true; } In this overrided method, how could i find the item of the list view that was clicked? Thanks in advance. Best Regards. Jose

    Read the article

  • Draw a Image on FullScreen mode Android

    - by Marcos Vasconcelos
    Hi, I already know how to get my Activity as fullscreen on Android, now I need to draw a Image in this screen. This is my XML layout. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/image01" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> This image is dynamic generated and drawed in the ImageView. This is my code on my Activity. public void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); } But when running, the Activity is FullScreen, but the ImageView is adjusted in the center. What's wrong?

    Read the article

  • Can't get ellipsis to work on Android

    - by Mark
    Hi, I have a TextView. I want it to ellipsize if longer than its available width. This does not work unless the input string has no spaces... can anyone provide an example of this working? I've tried different combinations of: singleLine="true" maxLines="1" scrollHorizontally="false" none of these have any effect. Again, if I supply a string that has no spaces in it, then the ellipsis appears correctly. What am I missing? I've tried this on 1.5, 1.6, 2.0, all same problem. Thanks

    Read the article

  • Pass a single boolean from an Android App to a libgdx game

    - by Doug Henning
    I'm writing an Android application that needs to pass a single boolean into an Android game that I am also writing. The idea is that the user does something in the App which will affect how the game operates. This is tricky with LIBGDX since I need to get the bool value into the Java files of the game, but of course, you can't call Android specific things from within LIBGDX's main Java files. I tried using an intent but of course the same problem persists. I can get the boolean into the MainActivity.Java of the android output of the game, but can't pass it along any further since the android output and the main java files don't know about each other. I have seen a few tutorials that explain how to use set up an interface in the LIBGDX java files that can call android things. This seems like wild overkill for what I want to do. I've been trying to use Android's Shared Preferences with LIBGDX's Gdx.app.getPreferences, but I can't make it work. Anyhelp would be MUCH appreciated. I've set up two hello world applications. One is a standard Android app, with a single button that is supposed to write "true" into the shared preferences. The other is a standard LIBGDX hello world that is supposed to do nothing but check that bool when launched and if true display one image to the screen, if false, display a different one. Here's the relevant bit of the Android code: import android.preference.PreferenceManager; public void onClick(View view) { if (view == this.boolButton){ final String PREF_FILE_NAME = "myBool"; SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_WORLD_WRITEABLE); SharedPreferences.Editor editor = preferences.edit(); editor.putBoolean("myBool", true); editor.commit(); } } And here's the relevant bit of the code from the LIBGDX main file: Preferences prefs = Gdx.app.getPreferences("myBool"); boolean switcher = prefs.getBoolean("myBool"); if(switcher == true){ texture = new Texture(Gdx.files.internal("data/worked512.png")); prefs.putBoolean("myBool", false); } else { texture = new Texture(Gdx.files.internal("data/libgdx.png")); } Everything compiles fine, it just doesn't work. I've spent HOURS googling trying to find a way to pass this single boolean from android into a LIBGDX main and I'm totally stumped. Thanks for your help.

    Read the article

  • Pass a single boolean from an Android App to a LIBGDK game

    - by Doug Henning
    I'm writing an Android application that needs to pass a single boolean into an Android game that I am also writing. The idea is that the user does something in the App which will affect how the game operates. This is tricky with LIBGDX since I need to get the bool value into the Java files of the game, but of course, you can't call Android specific things from within LIBGDX's main Java files. I tried using an intent but of course the same problem persists. I can get the boolean into the MainActivity.Java of the android output of the game, but can't pass it along any further since the android output and the main java files don't know about each other. I have seen a few tutorials that explain how to use set up an interface in the LIBGDX java files that can call android things. This seems like wild overkill for what I want to do. I've been trying to use Android's Shared Preferences with LIBGDX's Gdx.app.getPreferences, but I can't make it work. Anyhelp would be MUCH appreciated. I've set up two hello world applications. One is a standard Android app, with a single button that is supposed to write "true" into the shared preferences. The other is a standard LIBGDX hello world that is supposed to do nothing but check that bool when launched and if true display one image to the screen, if false, display a different one. Here's the relevant bit of the Android code: import android.preference.PreferenceManager; public void onClick(View view) { if (view == this.boolButton){ final String PREF_FILE_NAME = "myBool"; SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_WORLD_WRITEABLE); SharedPreferences.Editor editor = preferences.edit(); editor.putBoolean("myBool", true); editor.commit(); } } And here's the relevant bit of the code from the LIBGDX main file: Preferences prefs = Gdx.app.getPreferences("myBool"); boolean switcher = prefs.getBoolean("myBool"); if(switcher == true){ texture = new Texture(Gdx.files.internal("data/worked512.png")); prefs.putBoolean("myBool", false); } else { texture = new Texture(Gdx.files.internal("data/libgdx.png")); } Everything compiles fine, it just doesn't work. I've spent HOURS googling trying to find a way to pass this single boolean from android into a LIBGDX main and I'm totally stumped. Thanks for your help.

    Read the article

  • Does it make sense to use ORM in Android development?

    - by Heinzi
    Does it make sense to use an ORM in Android development or is the framework optimized for a tighter coupling between the UI and the DB layer? Background: I've just started with Android development, and my first instinct (coming from a .net background) was to look for a small object-relational mapper and other tools that help reduce boilerplate clode (e.g. POJOs + OrmLite + Lombok). However, while developing my first toy application I stumbled upon a UI class that explicitly requires a database cursor: AlphabetIndexer. That made me wonder if maybe the Android library is not suited for a strict decoupling of UI and DB layer and that I will miss out on a lot of useful, time-saving features if I try to use POJOs everywhere (instead of direct database access). Clarification: I'm quite aware of the advantages of using ORM in general, I'm specifically interested in how well the Android class library plays along with it.

    Read the article

  • uiview animation used to work on iphone sdk 2.2 and now it doesn't on sdk 3.0

    - by nico
    hello! I have an animation block that worked fine when runnung the app on iphone OS 2.2. Now I compile the same code for iphone OS 3.0 and it doesn't work. UIViewAnimationTransition trans = UIViewAnimationTransitionFlipFromLeft; [UIView beginAnimations: nil context: NULL]; UIView *forview = [[self view] superview]; [UIView setAnimationTransition: trans forView:forview cache: YES]; [UIView setAnimationDuration:1.0]; [[self navigationController] popViewControllerAnimated:NO]; [UIView commitAnimations]; What the code does, it uses the navigation controller to change the top most view, but with the flip transition and not with the built in one. any ideas on what might have change in the sdk or what I'm doing wrong? thanks!!

    Read the article

  • Image overlapping in widget

    - by Hunt
    I am trying to create a widget in android in which when I click over image the image gets changed with a new one -- kind of toggle image. But when I click over it, the image overwrites over the old one rather then replacing the new one. I don't know whether this is the way the widget works or am I doing something wrong. My images are semi-transparent so in case one overrides another one can see the image which is being overlapped. This is the code that I have written in OnReceive by overriding it: @Override public void onReceive(Context context, Intent intent){ if (intent.getAction().equals(iAlertConstant.ACTION_WIDGET_UPDATE_FROM_WIDGET)) { RemoteViews remoteViews = new RemoteViews(context.getPackageName(),R.layout.mywidget); remoteViews.setImageViewResource(R.id.btnOnOff,R.drawable.offbtn); ComponentName thisWidget = new ComponentName(context, EmergencyWidget.class); AppWidgetManager.getInstance(context).updateAppWidget(thisWidget, remoteViews); } else super.onReceive(context, intent); } Layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/widget_background" android:paddingLeft="10.0dip" android:paddingTop="8.0dip" android:paddingRight="10.0dip" android:paddingBottom="8.0dip" android:layout_width="fill_parent" android:layout_height="72dp" android:layout_marginLeft="10.0dip" android:layout_marginTop="10.0dip" android:layout_marginRight="10.0dip" android:id="@+id/emergencyWidget" android:orientation="horizontal"> <ImageView android:background="@drawable/offbtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="7dp" android:layout_marginLeft="4dp" android:layout_marginRight="4dp" android:layout_gravity="right" android:id="@+id/btnOnOff" /> </LinearLayout>

    Read the article

  • Button text loses allignment after clicking

    - by breathe0
    Strange things happen. I have a 4x4 button table layout, which is the following: <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/cerca"> <TableRow android:layout_width = "fill_parent" android:layout_height = "wrap_content"> <Button android:id = "@+id/btn1" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_weight="1" android:text = "Scarica POI da server" android:onClick="downloadFromServer" /> <Button android:id = "@+id/btn2" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_weight="1" android:text = "Aggiungi POI" android:onClick="goCreatePOI" /> </TableRow> <TableRow android:layout_width = "fill_parent" android:layout_height = "wrap_content"> <Button android:id = "@+id/btn3" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_weight="1" android:text = "Rimuovi i POI del server" android:onClick="removeServerPOI" /> <Button android:id = "@+id/btn4" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_weight="1" android:text = "Rimuovi i POI personali" android:onClick="removePersonalPOI" /> </TableRow> </TableLayout> This table layout is nested inside a relative layout, which is nested in a scrollview. Now, whenever i click on one of them, everytime the text inside the button change allignment: if before clicking was centered and displayed on two lines, after the click it loses its alignment and is displayed only in one row (cutting off some part of the text). Am I doing something wrong, or maybe it's a bug?

    Read the article

  • Stretching across 2 rows in Table Layout

    - by Will03uk
    How do I stretch across 2 columns in the Table Layout. I have 2 rows with a label and edit text on 1 row and I want to have a single button stretch across the whole second row. <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:background="#000000" android:stretchColumns="1"> <TableRow> <TextView android:text = "Name: " /> <EditText android:id = "@+id/txtAddName" android:gravity = "right" android:layout_width = "fill_parent" /> </TableRow> <TableRow> <TextView android:text = "Phone: " /> <EditText android:id = "@+id/txtAddPhone" android:gravity = "right" android:layout_width = "fill_parent" /> </TableRow> <TableRow> <Button android:id = "@+id/btnAdd" android:text = "Add Entrie" android:layout_width = "fill_parent" /> </TableRow> <TableRow> <Button android:id = "@+id/btnShow" android:text = "Show all Entries" android:layout_width = "fill_parent" /> </TableRow> <TableRow> <Button android:id = "@+id/btnDelete" android:text = "Delete all Entries" android:layout_width = "fill_parent" /> </TableRow> </TableLayout>

    Read the article

  • iPhone 3.1.3 sdk for Leopard

    - by mousebird
    Is it still possible to find the 3.1.3 SDK (w/ Xcode) for iPhone development on Leopard? I haven't upgraded to Snow Leopard yet, but I need to interact with devices running 3.1.3. I should have grabbed that version when it was up, but I didn't. So, does anyone have a link to the 3.1.3 iPhone SDK (w/ Xcode)?

    Read the article

  • Android: preferences not being stored automatically

    - by Vitaly
    I'm trying to use preference screen. I'm following all steps from online tutorial (once I couldn't get it working, I found other tutorials, and steps seem to be fine). I get to preferences screen, edit values, return to calling activity (via hardware return button). In DDMS perspective FileExplorer shows package_name_preferences.xml file with preferences that should be stored. It contains: <?xml version='1.0' encoding='utf-8' standalone='yes' ?> <map> <string name="false">kg</string> </map> while I expect (data line only shown). <string name="weight">kg</string> Also, if I go change only 1 preference, the same value changes, not a new row is created. I'm just tempted to write my own preference classes that would store data in files or DB, but I know that preferences should work, it just doesn't save properly my stuff. Edit Tutorials used: Main Tutorial - Was using this as a base, simplified, as I needed only 3 listPreferences so far. Another One - Used this one back when first installed android, so referred to this one for its section on preferences Code: (Screen loads, so I'm not showing Manifest) public class MyPrefs extends PreferenceActivity { @Override public void onCreate(Bundle bundle) { super.onCreate(bundle); addPreferencesFromResource(R.xml.my_prefs); } } my_prefs.xml <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:title="Value Settings"> <ListPreference android:title="Distance" android:summary="Metric (Kilometer) vs Imperial (Imperial)" android:defaultValue="km" android:key="@+id/distanceMesurement" android:entries="@array/distance" android:entryValues="@array/distance_values"/> <ListPreference android:title="Weight" android:summary="Metric (Kilogram) vs Imperial (Pound)" android:defaultValue="kg" android:key="@+id/weightMesurement" android:entries="@array/weight" android:entryValues="@array/weight_values"/> </PreferenceCategory> </PreferenceScreen> calling MyPrefs from MainScreen Intent i = new Intent(MainScreen.this, MyPrefs.class); startActivity(i); arrays.xml <resources> <string-array name="weight"> <item name="kg">Kilogram (kg)</item> <item name="lb">Pound (lb)</item> </string-array> <string-array name="weight_values"> <item name="kg">kg</item> <item name="lb">lb</item> </string-array> <string-array name="distance"> <item name="km">Kilometer (km)</item> <item name="mi">Mile (mi)</item> </string-array> <string-array name="distance_values"> <item name="km">km</item> <item name="mi">mi</item> </string-array> </resources>

    Read the article

  • android program crashing (new to platform)

    - by mutio
    So it is my first real Android program (!hello world), but i do have java experience.The program compiles fine, but on running it crashes as soon as it opens (tried debugging, but it crashes before it hits my breakpoint). Was looking for any advice from anyone who is more experienced with android. package org.me.tipcalculator; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import android.view.View; import android.widget.Button; import android.widget.EditText; import java.text.NumberFormat; import android.util.Log; public class TipCalculator extends Activity { public static final String tag = "TipCalculator"; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); final EditText mealpricefield = (EditText) findViewById(R.id.mealprice); final TextView answerfield = (TextView) findViewById(R.id.answer); final Button button = (Button) findViewById(R.id.calculate); button.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { try { Log.i(tag, "onClick invoked."); String mealprice = mealpricefield.getText().toString(); Log.i(tag, "mealprice is [" + mealprice + "]"); String answer = ""; if (mealprice.indexOf("$") == -1) { mealprice = "$" + mealprice; } float fmp = 0.0F; NumberFormat nf = java.text.NumberFormat.getCurrencyInstance(); fmp = nf.parse(mealprice).floatValue(); fmp *= 1.2; Log.i(tag, "Total Meal Price (unformatted) is [" + fmp + "]"); answer = "Full Price, including 20% Tip: " + nf.format(fmp); answerfield.setText(answer); Log.i(tag, "onClick Complete"); } catch(java.text.ParseException pe){ Log.i (tag ,"Parse exception caught"); answerfield.setText("Failed to parse amount?"); } catch(Exception e){ Log.e (tag ,"Failed to Calculate Tip:" + e.getMessage()); e.printStackTrace(); answerfield.setText(e.getMessage()); } } } ); } Just in case it helps heres the xml <?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Android Tip Calculator"/> <EditText android:id="@+id/mealprice" android:layout_width="fill_parent" android:layout_height="wrap_content" android:autoText="true"/> <Button android:id="@+id/calculate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Calculate Tip"/> <TextView android:id= "@+id/answer" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=""/> </LinearLayout>

    Read the article

  • How to resolve Android class issues: android.Manifest$permission and android.R?

    - by Maxood
    I have updated software and ADT in my Eclipse a number of times. I am unable to run projects above than 1.5.I have the following errors showing up in my console window after i create a HelloWorld project with API Level 4 (1.6): [2010-04-04 22:21:53 - Framework Resource Parser] Collect resource IDs failed, class android.R not found in E:\Android\android-sdk_r04-windows\android-sdk-windows\platforms\android-1.6\android.jar [2010-04-04 22:21:53 - Framework Resource Parser] Collect permissions failed, class android.Manifest$permission not found in E:\Android\android-sdk_r04-windows\android-sdk-windows\platforms\android-1.6\android.jar [2010-04-04 22:21:54 - Android Framework Parser] failed to collect preference classes How to resolve this issue?

    Read the article

  • how to Set already running activity, when user clicks on app icon on home screen

    - by Praveenb
    I have Two activities One splash screen, Player screen. When user clicks on my app icon first splash screen is displayed and then player screen When player activity is running, if user returns to the home screen and then again clicks on app icon, the application is starting from the splash screen again. can any one please help me out how to do any one of below 1) I need to close current running activity and reload application. or 2) I need to resume to the player screen directly. Please give me an example or reference to follow, Im beginner in android programing Thanks In advance

    Read the article

  • Eclipse, Android ndk, source files, and library project dependencies

    - by Android Noob
    In Microsoft Visual Studio 2010, it is possible to create a Solution with multiple projects and set dependencies between projects. I'm trying to figure out if the same thing can be done using Eclipse via the NDK. More specifically, I want to know if it is possible to create C source files in an ordinary Android project that can reference C header files in an Android library project. For example: Android library project: Sockets Ordinary Android project: Socket_Server Sockets contains all the C header/source files that are needed to do socket I/O. Socket_Server contains test code that makes calls to the functions that are defined in Sockets library project. This test code requires a header file that contains the function declaration of all API calls. I already set the library dependencies between the projects via: Properties > Android > Library > Add

    Read the article

  • how does scrolling in android listview work?

    - by gartenkralleb
    hi, i have an android-app with a listview in an activity. the listview has, if i call it so, three data states. no data loaded from inet - only one dummy item is visible, saying that data is loading data is loaded and shown in list one listitem is clicked and now shows more information for this listitem (so it is increased in its height) on every state change (1 - 2, 2 - 3) i call notifyDataSetChanged() on this ListAdapater. this causes the listview to scroll down to the last item. this is ugly in the first transition and even more ugly in the second because the clicked list item is now out of focus. as i can see, this happens with a google g1 with android 1.6. a htc touch with the same sdk acts like desired (i try to figure it out with some more devices). to avoid this i tried to read out getScrollY() and set this value back. but this returns 0. the reason for this return value i already found on stackoverflow in other qutestions. does anyone else comes along with my problem so far? why does the listview scrolls to the last item? it was mentioned, that listview does keep track on the scroll position. but it seems that it does not in my case. or may i call the wrong refresh method? is notifyDataSetChanged the correct one?

    Read the article

  • Android - Views in Custom Compound Component are not inflated (findByView returns null)

    - by Julian Arz
    I have made a Custom Component in XML, consisting of a button with an imageview stacked on top of it: <myapp.widget.ClearableCaptionedButton xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/ccbutton_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical|left" android:textAppearance="?android:attr/textAppearanceMedium" android:background="@android:drawable/edit_text"/> <ImageView android:id="@+id/ccbutton_clear" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dip" android:layout_alignRight="@id/ccbutton_button" android:layout_alignTop="@id/ccbutton_button" android:layout_alignBottom="@id/ccbutton_button"/> </myapp.widget.ClearableCaptionedButton> extract of java source code: public class ClearableCaptionedButton extends RelativeLayout implements OnClickListener { ... public ClearableCaptionedButton(Context context, AttributeSet attrs) { super(context, attrs); // some stuff that works fine } .. protected void onFinishInflate() { super.onFinishInflate(); mButton = (Button) findViewById(R.id.ccbutton_button); mClear = (ImageView) findViewById(R.id.ccbutton_clear); mButton.setText(""); // error here: mButton == null } My problem is similar to this one. When i try to find the views inside the custom compound, findViewById returns null. But, as you can see, i already added super(context, attrs); to the constructor. i am using the custom component directly in xml layout, like this: <LinearLayout> <!-- some stuff --> <de.pockettaxi.widget.ClearableCaptionedButton android:layout_width="fill_parent" android:layout_height="wrap_content" app:caption="to"/> </LinearLayout> can anybody spot something? thanks.

    Read the article

  • ActivityThread exception in Android?

    - by Praveen Chandrasekaran
    My Log CAT Value: 05-17 15:16:30.572: ERROR/ActivityThread(17448): Activity com.example.brown.Bru_Maps has leaked IntentReceiver android.net.NetworkConnectivityListener$ConnectivityBroadcastReceiver@432e6360 that was originally registered here. Are you missing a call to unregisterReceiver()? 05-17 15:16:30.572: ERROR/ActivityThread(17448): android.app.IntentReceiverLeaked: Activity com.example.brown.Bru_Maps has leaked IntentReceiver android.net.NetworkConnectivityListener$ConnectivityBroadcastReceiver@432e6360 that was originally registered here. Are you missing a call to unregisterReceiver()? 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher.<init>(ActivityThread.java:748) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread$PackageInfo.getReceiverDispatcher(ActivityThread.java:576) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ApplicationContext.registerReceiverInternal(ApplicationContext.java:770) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ApplicationContext.registerReceiver(ApplicationContext.java:757) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ApplicationContext.registerReceiver(ApplicationContext.java:751) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:290) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.net.NetworkConnectivityListener.startListening(NetworkConnectivityListener.java:138) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at com.google.android.maps.MapActivity.onResume(MapActivity.java:232) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1225) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.Activity.performResume(Activity.java:3559) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2838) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2866) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1819) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.os.Handler.dispatchMessage(Handler.java:99) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.os.Looper.loop(Looper.java:123) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread.main(ActivityThread.java:4203) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at java.lang.reflect.Method.invokeNative(Native Method) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at java.lang.reflect.Method.invoke(Method.java:521) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 05-17 15:16:30.572: ERROR/ActivityThread(17448): at dalvik.system.NativeStart.main(Native Method) What is the Activity Thread Exception in Android? Please Help.

    Read the article

  • Android : Customizing tabs on state : How do I make a selector a drawable

    - by Chrispix
    I know how to put the icon on each tab, that is no problem. I also ran across this : Stack Overflow thread on pretty much same thing I followed one of the links from that question, and found this Pretty much, it said use a selector defined in the xml, sure, did that. But there is no id associated w/ it so I am not sure how to get the selector function as a drawable so I can use it as the icon for the tabs. Maybe I am going about this the wrong way.. But this is what I have, and obviously missing something. <selector android:id="@+id/myselector" xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Non focused states --> <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/darklogo" /> <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/lightlogo" /> <!-- Focused states --> <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/lightlogo" /> <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/lightlogo" /> <!-- Pressed --> <item android:state_pressed="true" android:drawable="@drawable/lightlogo" /> </selector> In my code, an example tab is generated using : host.addTab(host.newTabSpec("three") .setIndicator("map",drawables) .setContent(new Intent(this, Map.class))); Right now drawables is just a reference to an drawable image resource. How do I make the selector a drawable? * This is my question *

    Read the article

  • possible xml elements in Android resources xmls ?

    - by Vijay C
    I recently came across a forum post in thelink text android developers group. (link below) It has one post which contains following xml. It is xml file which can be used in drawable folder. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Non focused states --> <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/tab_unselected" /> <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected" /> <!-- Focused states --> <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/tab_focus" /> <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_focus"/> <!-- Pressed --> <item android:state_pressed="true" android:drawable="@drawable/tab_press" /> </selector> Now my question is, where is the documentation which tells me that i can use the following xml tags <selector> , <item>, <color>, <integer-array>, <string-array> and many others tag to create xml resources...? I hope, i have explained what i want to know ?

    Read the article

  • Android "first time" app user tutorial

    - by EGHDK
    I'm trying to create an opening tutorial that consists of four panes for my application, but since I'm new to Android, I want to make sure I'm considering all of my options before marking this task as "complete". I know of three ways, I can only really accomplish one. There are no requirements for this tutorial, but some "wanted features" would be a sliding action to each pane would be nice as well as the image and the bottom (navigation circles) not moving and the title on top not moving. One Way 4 separate activities and 4 separate layouts The red circled items are textViews that are centered horizontally and pushed off the top. The white circled items are imageViews that are centered horizontally and vertically. The purple circled are imageViews that are centered horizontally and pushed off the bottom. Second Way 4 fragments on one activity Fragments were difficult to learn, but the more I read about them/see tutorials on them, they seem to only really be used for tablets. Would it be a valid way to accomplish this? Third Way ViewPager? http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html I've never used this before, but I know it's an option. Final Question Which way is used more often/what's the proper way to implement this? Is there any way to only have the middle part (the image) slide in, but the title (top) and the navigation images (bottom) just change once the image slides in?

    Read the article

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