Search Results

Search found 13533 results on 542 pages for 'android activity'.

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

  • How to pass object from one activity to another in android

    - by kaibuki
    Hi I am trying to work on sending an object of my "Customer" class from one activity and display on other activity. the code for the customer class : `package com.kaibuki; public class Customer { private String firstName, lastName, Address; int Age; public Customer(String fname, String lname, int age, String address) { firstName = fname; lastName = lname; Age = age; Address = address; } public String printValues() { String data = null; data = "First Name :" + firstName + " Last Name :" + lastName + " Age : " + Age + " Address : " + Address; return data; } } I want to send its object from one activity to another and then display the data on the other activity. Please need urgent help. Thanks alot Kai`

    Read the article

  • Conditional restart on Activity onConfigurationChanged

    - by yuku
    I want to make an activity that allows orientation changes on some condition, but not otherwise. More exactly I want to prevent restarting the activity when a background thread is busy. I have put the configChanges attribute on the activity manifest, and onConfigurationChanged is called when the orientation changes. However I want to allow the app to change the orientation when allowed. @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (orientationChangeAllowed) { // how to I restart this activity? } else { // don't do anything } }

    Read the article

  • Linear layout and custom dialog

    - by DixieFlatline
    The button doesn't show in this layout(code below),image and textview are shown. I tried using relative layout but that doesn't help either. I'm testing it on 1.5 emulator. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/neki" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="10dp" /> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="fill_parent" android:textColor="#FFF" android:text="Some text " /> </LinearLayout> <Button android:id="@+id/gumbek" android:text="V redu" android:typeface="serif" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout>

    Read the article

  • Android Window Mananger leacked windwo progress dialog

    - by saravanan-palpandi
    05-14 16:53:52.273: ERROR/WindowManager(412): Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43db2e68 that was originally added here 05-14 16:53:52.273: ERROR/WindowManager(412): android.view.WindowLeaked: Activity com.sss.client.AddClient has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43db2e68 that was originally added here 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.ViewRoot.(ViewRoot.java:227) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.Window$LocalWindowManager.addView(Window.java:424) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.app.Dialog.show(Dialog.java:239) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.app.ProgressDialog.show(ProgressDialog.java:107) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.app.ProgressDialog.show(ProgressDialog.java:90) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.app.ProgressDialog.show(ProgressDialog.java:85) 05-14 16:53:52.273: ERROR/WindowManager(412): at com.sss.client.AddClient.searchValues(AddClient.java:236) 05-14 16:53:52.273: ERROR/WindowManager(412): at com.sss.client.AddClient.clientFormAction(AddClient.java:264) 05-14 16:53:52.273: ERROR/WindowManager(412): at java.lang.reflect.Method.invokeNative(Native Method) 05-14 16:53:52.273: ERROR/WindowManager(412): at java.lang.reflect.Method.invoke(Method.java:521) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.View$1.onClick(View.java:2026) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.View.performClick(View.java:2364) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.View.onTouchEvent(View.java:4179) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.widget.TextView.onTouchEvent(TextView.java:6540) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.View.dispatchTouchEvent(View.java:3709) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 05-14 16:53:52.273: ERROR/WindowManager(412): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659) 05-14 16:53:52.273: ERROR/WindowManager(412): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.app.Activity.dispatchTouchEvent(Activity.java:2061) 05-14 16:53:52.273: ERROR/WindowManager(412): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.os.Handler.dispatchMessage(Handler.java:99) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.os.Looper.loop(Looper.java:123) 05-14 16:53:52.273: ERROR/WindowManager(412): at android.app.ActivityThread.main(ActivityThread.java:4363) 05-14 16:53:52.273: ERROR/WindowManager(412): at java.lang.reflect.Method.invokeNative(Native Method) 05-14 16:53:52.273: ERROR/WindowManager(412): at java.lang.reflect.Method.invoke(Method.java:521) 05-14 16:53:52.273: ERROR/WindowManager(412): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 05-14 16:53:52.273: ERROR/WindowManager(412): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 05-14 16:53:52.273: ERROR/WindowManager(412): at dalvik.system.NativeStart.main(Native Method) when show the dialog box it show the error message please do reply me

    Read the article

  • android surfaceview is no longer visible after back from other activity

    - by user308748
    i have a question in developing some android program... i use surfaceview for camera preview. it works fine, but has one problem when i start other activity (by clicking something) and then back from that activity. after that, surfaceview is no longer visible. (but onclicklistener is working) but when i occur surfacecreated/destoryed by visible/invisible surfaceview in single activity, it works very good. plz give me any help.

    Read the article

  • Positioning elements outside an Activity on Android

    - by Aleksander Kmetec
    Is there a way to absolutely position an UI element on Android so that it is located outside an Activity? For example: can you create a fullscreen ImageView simply by moving/resizing an ImageView inside an existing regular Activity instead of creating a new fullscreen activity? EDIT: Re-reading my question I see I wasn't very clear about what I'm trying to accomplish. I'd like to temporarily extend an element to cover the notification bar at the top of the screen. I need to create a semitranslucent fullscreen overlay but since translucent activities cannot cover the notification bar I'm trying to find out if it's possible for an element to break out of activity's bounds and resize itself to fill the whole screen, top to bottom.

    Read the article

  • Click on notification starts activity twice

    - by Karussell
    I'm creating a notification from a service with the following code: NotificationManager notificationManager = (NotificationManager) ctx .getSystemService(Context.NOTIFICATION_SERVICE); CharSequence tickerText = "bla ..."; long when = System.currentTimeMillis(); Notification notification = new Notification(R.drawable.icon, tickerText, when); Intent notificationIntent = new Intent(ctx, SearchActivity.class). putExtra(SearchActivity.INTENT_SOURCE, MyNotificationService.class.getSimpleName()); PendingIntent contentIntent = PendingIntent.getActivity(ctx, 0, notificationIntent, 0); notification.setLatestEventInfo(ctx, ctx.getString(R.string.app_name), tickerText, contentIntent); notification.flags |= Notification.FLAG_AUTO_CANCEL; notificationManager.notify(1, notification); The logs clearly says that the the method startActivity is called twice times: 04-02 23:48:06.923: INFO/ActivityManager(2466): Starting activity: Intent { act=android.intent.action.SEARCH cmp=com.xy/.SearchActivity bnds=[0,520][480,616] (has extras) } 04-02 23:48:06.923: WARN/ActivityManager(2466): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.intent.action.SEARCH cmp=com.xy/.SearchActivity bnds=[0,520][480,616] (has extras) } 04-02 23:48:06.958: INFO/ActivityManager(2466): Starting activity: Intent { act=android.intent.action.SEARCH cmp=com.xy/.SearchActivity bnds=[0,0][480,96] (has extras) } 04-02 23:48:06.958: WARN/ActivityManager(2466): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.intent.action.SEARCH cmp=com.xy/.SearchActivity bnds=[0,0][480,96] (has extras) } 04-02 23:48:07.087: INFO/notification(5028): onStartCmd: received start id 2: Intent { cmp=com.xy/.NotificationService } 04-02 23:48:07.310: INFO/notification(5028): onStartCmd: received start id 3: Intent { cmp=com.xy/.NotificationService } 04-02 23:48:07.392: INFO/ActivityManager(2466): Displayed activity com.xy/.SearchActivity: 462 ms (total 462 ms) 04-02 23:48:07.392: INFO/ActivityManager(2466): Displayed activity com.xy/.SearchActivity: 318 ms (total 318 ms) Why are they started twice? There are two identical questions on stackoverflow: here and here. But they do not explain what the initial issue could be and they do not work for me. E.g. changing to launchMode singleTop is not appropriated for me and it should work without changing launchMode according to the official docs (see Invoking the search dialog). Nevertheless I also tried to add the following flags to notificationIntent Intent.FLAG_ACTIVITY_CLEAR_TOP | PendingIntent.FLAG_UPDATE_CURRENT but the problem remains the same.

    Read the article

  • Self updating app, wont overwrite existing app, using Android packagemanager?

    - by LokiSinclair
    I know there are plenty of questions about this on here, but I've tried everything (but the correct 'thing', obviously!) and nothing seems to shine any light on the problem I'm having. I've written an app (for a customer), which is designed to be hosted on their own server. The app references a simple text file with the latest version code in it and checks it against it's own version. If it's out of date it goes off and downloads the update. Everything is working as intended up to this point. I use the: Intent i = new Intent(Intent.ACTION_VIEW); i.setDataAndType(Uri.fromFile(outputFile), "application/vnd.android.package-archive"); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); ...code to start the install process of the newly downloaded .apk file. And that all starts as I would expect. I click on "Install" - when I'm prompted to confirm the overwriting of the current app, with the new. It starts, and then displays: App not installed. And existing package by the same name with a conflicting signature is already installed. Now I'm aware that Android can't have multiple applications sharing the same package name, which is fine, but nothing comes up in LogCat and I can only assume that the OS is annoyed at me attempting to 'update' my app, even though I'm going through all the correct channels and using the inbuilt package manager to do it for me! Can anyone tell me what the OS is moaning about? I'm not attempting to install two apps side by side, I want it to update it, which it starts to do, and then gets really confused. Is it something to do with me using the same keystore for signing the packages? I highly doubt it as I've used the same keystores previously to handle updates to games and the like, but I just can't figure out what it's complaining about. Hopefully someone out there has had this issue and solved it, and can point me in the right direction. I'm flying a bit blind with the limited information it's giving me :( Cheers.

    Read the article

  • Allowing AsyncTask to Manipulate Values in Different Activity Classes

    - by Matt
    Hi guys, This title may seem strange, so let me try to explain what I'm trying to do. I have several activity classes, each representing a different view in my application. My initial activity class gets loaded when the application launches. The user enters values and eventually a TCP socket is opened, and I then use AsyncTask to listen for and respond to messages from the server. I'd like for this AsyncTask class to essentially listen until the app is closed/error condition reached, and be able to update values in other activity classes after they are started. Does this make sense (it's been a long, frustrating night)? I know that static activity class references are bad practice, and touching the UI thread from other activities is bad as well, but I'm having trouble finding a clean solution to this problem. Maybe using AsyncTask is not the best approach here? Should I be using a service instead or something else entirely? Thanks in advance.

    Read the article

  • Listing an application's activity and intent-filters?

    - by MBonig
    I am interested in activating another application's activity. I know from reading the Android SDK that it's probably better to do this with an implicit intent. However, this activity doesn't reside in an application I own, so I don't know the action and category and data flags on the intent-filter. How can I examine an Android applications metadata like the activity classes and the intent-filters for those activities (if declared in the manifest)? Thanks!

    Read the article

  • Problems with starting an activity in onStart

    - by Fizz
    Hello everyone. I'm trying to start a floating activity from onStart to retrieve some info from the user right when the initial activity begins. I have the following: @Override public void onStart(){ super.onStart(); callProfileDialog(); } And callProfileDialog() is just: private void callProfileDialog(){ Intent i = new Intent(this, com.utility.ProfileDialog.class); startActivityForResult(i, PROFDIALOG); } ProfileDialog.class returns a String from an input box. If the result returned is RESULT_CANCELED then I restart the activity. The problem I'm having is that when the program starts, the screen is just black. If I hit the Back button a RESULT_CANCELED is returned then the initial activity shows as well as the floating activity (since it recalled itself when it got a RESULT_CANCELED). Why can't I get the activities show by calling ProfileDialog.class from onStart()? I got the same result when I called it at the end of onCreate() which is way I switch over to use onStart(). Thanks for the help.

    Read the article

  • Prevent Activity from saving state when user selects back button

    - by martinjd
    I have an Activity with a list that is bound to a ListAdapter reading data into a ArrayList from a database. All is well when the data is first loaded. While the Activity is open and the list is being displayed it is possible and likely that the data in the database will be updated by a service but the list does not reflect the changes because the ArrayList does not know about the changes. If the Activity is no longer in the foreground as would be the case if the user goes to the home screen and then is brought back to the foreground I would like for the Activity to not display what it did prior but rather reload the data using the ListAdapter the view is bound to. I think something needs to call finish() but I am not sure what. This is what I have in the Activity. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setUpViews(); app = (MyApplication) getApplication(); adapter = new MyListAdapter(this, app.getMyEvents()); setListAdapter(adapter); } @Override protected void onResume() { super.onResume(); adapter.forceReload(); }

    Read the article

  • ListView Item Detail Screen: New or Same Activity?

    - by stormin986
    I have a listview where each item correlates to an instance of an item in an array. When the user selects an item, it will bring up a 'Details' page that reads and displays other data members of the list item. Would this be better implemented with the Details page as its own activity, or a new view within the same activity? Pros and cons of each? A new activity makes my job a little easier in terms of handling the 'back' button, but then I have the challenge of how do I pass the rest of the data structure to the new activity since I can't bundle it up (unless I serialize it).

    Read the article

  • Android never receives UDP packet

    - by Quandary
    The below code results in a timeout. It works fine on non-Android Java. What's the matter? //@Override public static void run() { //System.out.println ( "Local Machine IP : "+addrStr.toString ( ) ) ; HelloWorldActivity.tv.setText("Trace 1"); try { // Retrieve the ServerName InetAddress serverAddr; //= InetAddress.getByName(Server.SERVERIP); InetAddress ias[] = InetAddress.getAllByName(Server.SERVERNAME); serverAddr = ias[0]; Log.d("UDP", "C: Connecting..."); /* Create new UDP-Socket */ DatagramSocket socket = new DatagramSocket(); /* Prepare some data to be sent. */ String strQuery="ÿÿÿÿgetservers"+" "+Server.iProtocol+" "+"'all'"; Log.d("UDP", strQuery); //byte[] buf = ("ÿÿÿÿgetservers 68 'all'").getBytes(); byte[] buf = strQuery.getBytes(); /* Create UDP-packet with * data & destination(url+port) */ DatagramPacket packet = new DatagramPacket(buf, buf.length, serverAddr, Server.SERVERPORT); Log.d("UDP", "C: Sending: '" + new String(buf) + "'"); /* Send out the packet */ socket.setSoTimeout(5000); socket.send(packet); Log.d("UDP", "C: Sent."); Log.d("UDP", "C: Done."); // http://code.google.com/p/android/issues/detail?id=2917 byte[] buffer= new byte[1024*100]; DatagramPacket receivePacket = new DatagramPacket(buffer, buffer.length); //, serverAddr, Server.SERVERPORT); socket.receive(receivePacket); HelloWorldActivity.tv.setText("TTT"); String x = new String(receivePacket.getData()); Log.d("UDP", "C: Received: '" + x + "'"); HelloWorldActivity.tv.setText(x); } catch (Exception e) { HelloWorldActivity.tv.setText(e.getMessage()); Log.e("UDP", "C: Error", e); } } public class Server { /* //public static java.lang.string SERVERIP; public static String SERVERNAME = "monster.idsoftware.com"; public static String SERVERIP = "192.246.40.56"; public static int SERVERPORT = 27950; public static int PROTOCOL = 68; */ //public static String SERVERNAME="monster.idsoftware.com"; public static String SERVERNAME="dpmaster.deathmask.net"; public static String SERVERIP="192.246.40.56"; public static int SERVERPORT=27950; //public static int iProtocol= 68; // Quake3 public static int iProtocol=71; // OpenArena } Android manifest: <?xml version="1.0" encoding="utf-8"?> <use-permission id="android.permission.READ_CONTACTS" /> <use-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_GPS" /> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" /> <uses-permission android:name="android.permission.ACCESS_CELL_ID" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <application android:icon="@drawable/icon" android:label="AAA New Application" > <activity android:name="HelloWorldActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application>

    Read the article

  • Can I use android.os.* libraries in a standalone project?

    - by medicdave
    I'm trying to develop an external library (not sure if that's the right term) to provide prepackaged functionality in Android projects. Working in Eclipse, I've added the appropriate android.jar file to the build path, and everything is happy both while editing and upon compilation. However, when I use Android's Handler and Message classes (android.os.Handler, android.os.Message) for inter-thread communication, I get exceptions unless I'm running within an Android app, on the emulator or a device. I can no longer test my library in a "standalone" way without having to go through a running Android target. Is there any way for me to include these two Android classes and still be able to test my library standalone? Do I need to have the Android source available? Or would it require some sort of conditional compilation hand-waving?

    Read the article

  • How to publish paid Android apps if you're not from US/UK

    - by Sheikh Aman
    I was pretty excited while creating one of my apps but as it turns out you can't actually sign up for Google Checkout if you don't live either in the USA or in the UK. And since Google Checkout is the only way Android Market will pay you, all my efforts seem to be going in vain. So because I live in India, I can't sell my apps. I tried contacting Google by various means on this, but haven't got any response so far. I tried searching the web as well just to find out that one can't be paid via any other way. I am pretty sure that many people here might have gone through the same problem. How did you solve it? I have a PayPal account and an AdSense account as well. Can they help in any way? And if nothing works out, how am I supposed to be selling my app?

    Read the article

  • Databinding a ListView with Mono for Android

    - by Wallym
    The world lives on data. Data is all around us and in many forms: salespeople need to know what customers have spent; twitter users want to know what their friends are saying. How do we as developers present data to a user? In Android, we use the ListView in its various forms. In this article, we'll look at using a ListView, how we can work with it, then discuss what we need to do to overcome some of the challenges in a mobile environment.Article url: http://visualstudiomagazine.com/articles/2012/09/14/databind-a-listview.aspx

    Read the article

  • Why is Android VM-based? [closed]

    - by adib
    By about 2004, it was clear that ARM is the clear winner for mobile CPUs, beating out MIPS, SH3, and DragonBall. PocketPC (Windows Mobile) applications was natively-compiled (at least most of them - except for .NET compact and its competitors). Likewise, Apple's iOS (named iPhone OS at the time) prefers natively-compiled applications. Then why Android chose a virtual machine based system stack? (the Dalvik VM). Wouldn't it be simpler to just compile applications down to ARM code using GCJ or something? Is the decision influenced by the J2ME-way of doing things, or was just because it's "cool"? Perhaps like most things Java, the culture that prefers multiple levels of indirection and abstractions, they just added another layer of abstraction for "just in case"?

    Read the article

  • Android design advice - services & broadcast receivers

    - by basudz
    I'm in the process of learning the Android SDK and creating some projects to get a grasp on the system. The current project I'm working with works just fine but I'd like to get some advice about other ways I can go about designing it. Here's what it needs to do. When a text message is received from a specific number, it should fire off a toast message that repeats at a certain interval for a specific duration. To make this work, I created an SMS BroadcastReceiver and checked the incoming messages for the number I'm looking for. If found, an IntentService would be started that would pull out the interval and duration from saved shared prefs. The IntentService would then fire off a broadcast. The BroadcastReceiver for this would catch it and use the AlarmManager to handle the toast message repetitions. This all works just fine, but I'm wondering if there's a cleaner or more efficient way of going about doing this? Any suggestions or advice?

    Read the article

  • Problem with TextViews running into each other in RelativeLayout

    - by Janusz
    I have a problem with two Textviews on the same height in a RelativeLayout running into each other. I use the following Layout. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerInside" android:src="@drawable/icon" /> <TextView android:id="@+id/name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="NameNameNameNameNameNameName" android:layout_alignParentTop="true" android:layout_toRightOf="@id/logo" android:gravity="clip_horizontal" android:lines="1" /> <TextView android:id="@+id/information" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="information" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /> <TextView android:id="@+id/nrcoupons" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Number" android:layout_alignRight="@id/information" android:layout_alignBottom="@id/logo" /> <TextView android:id="@+id/subcategory" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Subcategory" android:layout_alignLeft="@id/name" android:layout_alignBottom="@id/logo" /> </RelativeLayout> This gives me this view: Everything is as I need it except the two textviews name and information are displayed on the same screen space with the one on top of the other. How can I avoid this?

    Read the article

  • Is there a difference between starting an application from the OS or from adb

    - by aruwen
    I do have a curious error in my application. My app crashes (don't mind the crash, I roughly know why - classloader) when I start the application from the OS directly, then kill it from the background via any Task Killer (this is one of the few ways to reproduce the crash consistently - simulating the OS freeing memory and closing the application) and try to restart it again. The thing is, if I start the application via adb shell using the following command: adb shell am start -a android.intent.action.MAIN -n com.my.packagename/myLaunchActivity I cannot reproduce the crash. So is there any difference in how Android OS calls the application as opposed to the above call? EDIT: added the manifest (just changed names) <?xml version="1.0" ?> <manifest android:versionCode="5" android:versionName="1.05" package="com.my.sample" xmlns:android="http://schemas.android.com/apk/res/android"> <uses-sdk android:minSdkVersion="7"/> <application android:icon="@drawable/square_my_logo" android:label="@string/app_name"> <activity android:label="@string/app_name" android:name="com.my.InfoActivity" android:screenOrientation="landscape"></activity> <activity android:label="@string/app_name" android:name="com.my2.KickStart" android:screenOrientation="landscape"/> <activity android:label="@string/app_name" android:name="com.my2.Launcher" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/></manifest> starting the com.my2.Launcher from the adb shell

    Read the article

  • Spinner original text

    - by user1696863
    I'm trying my Spinner to display "Select City" before the Spinner has itself been clicked by the user. How can I do this? My current XML code 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:background="@drawable/page_background" 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" android:layout_marginTop="40dp" android:prompt="@string/selectCity" /> </LinearLayout> Also, what does android:spinnerMode exactly do. I tried changing its value to dropdown but nothing happened and the application still showed a popup dialogue. My activity that implements this XML file is: public class RateCardActivity extends OlaActivity { 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); } }

    Read the article

  • Layout: how to make image to change its width and height proportionally?

    - by Exterminator13
    I have such layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_toLeftOf="@+id/my_image" android:ellipsize="end" android:singleLine="true" android:text="Some text" android:textAppearance="?android:attr/textAppearanceMedium" /> <ImageView android:id="@+id/my_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/title" android:layout_alignBottom="@+id/title" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:adjustViewBounds="true" android:src="@drawable/my_bitmap_image" /> This layout does almost what I need: it makes image view height the same as text view. The image graphic contents stretched also keeping aspect ratio. But, the width of the image view does not change! As a result, I have a wide gap between text and the image view! As a temporal solution, I override View#onLayout. The question: how to change image width in xml layout? UPDATE: This is a final layout I need (text + a few images). Look at the first image: its width should be exactly the same as scaled image in it with no paddings and margins:

    Read the article

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