Search Results

Search found 12035 results on 482 pages for 'android emulator'.

Page 3/482 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to create sliding drawer in both sides opposite to one another?

    - by janmejoy
    I have added the code that working for right to left sliding perfectly but i want sliding from left to right also so check the layout and help me out.Here i have mentioned the layout properly for right to left ,Is it possible to get the Slider window in both sides i mean left and right horizontally... <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg" android:orientation="vertical" > <Button android:id="@+id/ship" android:layout_width="186dp" android:layout_height="23dp" android:layout_marginTop="49dp" android:background="@drawable/signup" android:text="Shipping Calculator" android:textColor="#ffffffff" android:layout_gravity="center" android:textStyle="bold" /> </LinearLayout> <SlidingDrawer android:id="@+id/drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:handle="@+id/handle" android:content="@+id/content"> <ImageView android:id="@+id/handle" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tag"/> <LinearLayout android:id="@+id/content" android:layout_width="wrap_content" android:layout_height="fill_parent" android:background="@drawable/slidimage" android:orientation="vertical" android:padding="10dp" > <TextView android:id="@+id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="15dp" android:layout_marginLeft="51dp" android:text="SIGN-UP" android:textColor="#000000" android:textSize="28dp" android:textStyle="bold" /> </LinearLayout> </SlidingDrawer> <SlidingDrawer android:id="@+id/drawers" android:layout_width="match_parent" android:layout_height="match_parent" android:handle="@+id/handles" android:layout_gravity="left" android:scrollX="100dp" android:orientation="horizontal" android:content="@+id/contents"> <ImageView android:id="@+id/handles" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="left" android:src="@drawable/tag"/> <LinearLayout android:id="@+id/contents" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="left" android:background="@drawable/slidimage" android:orientation="vertical" android:padding="10dp" > <TextView android:id="@+id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="15dp" android:layout_marginLeft="51dp" android:text="SIGN-UP" android:textColor="#000000" android:textSize="28dp" android:textStyle="bold" /> </LinearLayout> </SlidingDrawer> </FrameLayout>

    Read the article

  • android listview button control

    - by Josemalive
    Hi, I have an android listview filled with items. Every item has a button. This is the template of the my listview. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:paddingBottom="6dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingLeft="5px" android:paddingTop="5px" android:paddingRight="5px" android:gravity="left"> <TextView android:id="@+id/TextView_test1" android:layout_width="200dip" android:paddingLeft="0px" android:layout_height="wrap_content"/> <TextView android:id="@+id/TextView_test2" android:layout_width="250dip" android:paddingLeft="0px" android:layout_height="wrap_content" android:layout_weight="1"/> <TextView android:id="@+id/TextView_test3" android:layout_width="400dip" android:paddingLeft="0px" android:layout_height="wrap_content" android:layout_weight="1"/> <Button android:id="@+id/Button_buttontest" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/Button_buttontest"/> </LinearLayout> How could i handle the click of each button in the activity code? Each button has the same id "Button_buttontest"? Thanks in advance. Best Regards. Jose

    Read the article

  • android: tablerow mixed with columns and multiline text

    - by Yang
    I am trying to have a tablelayout contains several tablerows. One of the rows contains 4 buttons, while the second row contains a very long text. However, the width of the button stretches with the text in the second row. Is there anyway to prevent this? http://img684.imageshack.us/i/tableview1.jpg/ http://img521.imageshack.us/i/tableview2.jpg/ Here is my xml file: (somehow this website is not friendly to xml file) AbsoluteLayout android:id="@+id/widget0" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" TableLayout android:id="@+id/widget28" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_x="0px" android:layout_y="10px" TableRow android:id="@+id/widget29" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" Button android:id="@+id/widget30" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget31" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget32" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget33" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" TableRow android:id="@+id/widget35" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" TextView android:id="@+id/widget40" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TextViewTextViewTextViewTextViewTextViewTextView"

    Read the article

  • Mono for Android Book has been Released!!!!!

    - by Wallym
    If I understand things correctly, and I make no guarantees that I do, our Mono for Android book has been RELEASED!  I'm not quite sure what this means, but my guess is that that it has been printed and is being shipped to various book sellers.So, if you have pre-ordered a copy, its now up to Amazon to send it to you.  Its fully out of my control, Wrox, Wiley, as well as everyone but Amazon.If you haven't bought a copy already, why?  Seriously, go order 8-10 copies for the ones you love.  They'll make great romantic gifts for the ones you love.  Just think at the look on the other person's face when you give them a copy of our book. Here's a little about the book:The wait is over! For the millions of .NET/C# developers who have been eagerly awaiting the book that will guide them through the white-hot field of Android application programming, this is the book. As the first guide to focus on Mono for Android, this must-have resource dives into writing applications against Mono with C# and compiling executables that run on the Android family of devices.Putting the proven Wrox Professional format into practice, the authors provide you with the knowledge you need to become a successful Android application developer without having to learn another programming language. You'll explore screen controls, UI development, tables and layouts, and MonoDevelop as you become adept at developing Android applications with Mono for Android.Develop Android apps using tools you already know—C# and .NETAimed at providing readers with a thorough, reliable resource that guides them through the field of Android application programming, this must-have book shows how to write applications using Mono with C# that run on the Android family of devices. A team of authors provides you with the knowledge you need to become a successful Android application developer without having to learn another programming language. You'll explore screen controls, UI development, tables and layouts, and MonoDevelop as you become adept at planning, building, and developing Android applications with Mono for Android.Professional Android Programming with Mono for Android and .NET/C#:Shows you how to use your existing C# and .NET skills to build Android appsDetails optimal ways to work with data and bind data to controlsExplains how to program with Android device hardwareDives into working with the file system and application preferencesDiscusses how to share code between Mono for Android, MonoTouch, and Windows® Phone 7Reveals tips for globalizing your apps with internationalization and localization supportCovers development of tablet apps with Android 4Wrox Professional guides are planned and written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.Now, go buy a bunch of copies!!!!!If you are interested in iPhone and Android and would like to get a little more knowledgeable in the area of development, you can purchase the 3 pack of books from Wrox on Mobile Development with Mono.  This will cover MonoTouch, Mono for Android, and cross platform methods for using both tools.  A great package in and of itself.  The name of that package is: Wrox Cross Platform Android and iOS Mobile Development Three-Pack 

    Read the article

  • Android : uploaded .apk file to server but cant download that .apk file

    - by rahul
    hiiiiiiii, I have uploaded my application's .apk file to server. When i try to download tht .apk file to my android HTC HERO phone then it gives error saying "file size cannot be determined". I also enabled settings to "allow install of non-Market applications" in my HTC HERO. plz help me if i am missing somthing . and is there any signing we have to do in android like symbian signing in Symbian Devices???

    Read the article

  • Toggle Android emulator network traffic from emulator invocation

    - by highphi
    I'm working on scripts to manage large amounts of Android emulators and I need to disable all network traffic on some of them. Because I'm doing all of this on a headless server, I cannot use the F8 hotkey described on the emulater documentation. I'm currently routing the TCP traffic through a null proxy with by using emulator-arm ... -http-proxy 0.0.0.0:0 and this blocks the traffic that I want it to. I thought this was working well until I noticed some strange error messages while running my scripts. The console started outputting accept too many open files and checking the open files with lsof reveals numerous messages stating "can't identify protocol" ... emulator- 19463 username 19u sock 0,6 0t0 1976595845 can't identify protocol emulator- 19463 username 20u sock 0,6 0t0 1976595847 can't identify protocol ... The only "solution" I found to this is to kill all of the emulators and then wait until this limit is reached again, which is hardly a solution at all. Is there another way to do this while invoking the emulator? Am I incorrectly using the -htt-proxy switch to block the traffic? Other people found solutions to block traffic by manually doing this by using airplane mode, but this isn't feasible for me as I'm controlling emulators via scripts. I could send keyevents to the emulator with my script and turn the phone on in airplane mode, but I would prefer something more reliable than this.

    Read the article

  • Android layout with 2 evenly spaced Buttons

    - by Rpond
    I have this layout that works correctly, a relative layout with a text view and two buttons spaced evenly below it. <RelativeLayout android:id="@+id/entrypopup" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5px" android:visibility="gone" android:layout_below="@+id/ad" android:background="#80000000"> <TextView android:id="@+id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Entry Popup..." android:textColor="#ffffffff" android:textSize="20sp" /> <TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/title"> <TableRow android:layout_weight="1"> <Button android:id="@+id/buttonVisit" android:text="View" android:layout_height="fill_parent" android:layout_width="0dip" android:layout_weight="1"/> <Button android:id="@+id/buttonCancel" android:text="Cancel" android:layout_width="0dip" android:layout_weight="1" android:layout_height="fill_parent"/> </TableRow> </TableLayout> </RelativeLayout> But running layoutopt it says that "this TableRow layout or its TableLayout parent is possible useless". Is there a way to do this layout then without the tables?

    Read the article

  • Drawing lines between views in a TableLayout

    - by RiThBo
    Firstly - sorry if you saw my other question which I deleted. My question was flawed. Here is a better version If I have two views, how do I draw a (straight) line between them when one of them is touched? The line needs to be dynamic so it can follow the finger until it reaches the second view where it "locks on". So, when view1 is touched a straight line is drawn which then follows the finger until it reaches view2. I created a LineView class that extends view, but I don't how to proceed. I read some tutorials but none show how to do this. I think I need to get the coordinates of both view, and then create a path which "updates" on MotionEvent. I can get the coordinates and the ids of the views I want to draw a line between, but the line that I try to draw between them either goes above it, or the line does not reach past the width and height of the view. Any advice/code/clarity would be much appreciated! Here is some code: My layout. I want to draw a line between two views contained in theTableLayout.# <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_game_relative_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TableLayout android:layout_marginTop="35dp" android:layout_marginBottom="35dp" android:id="@+id/tableLayout1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" > <TableRow android:id="@+id/table_row_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dip" > <com.example.view.DotView android:id="@+id/game_dot_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" /> <com.example.view.DotView android:id="@+id/game_dot_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" /> <com.example.view.DotView android:id="@+id/game_dot_3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" /> </TableRow> <TableRow android:id="@+id/table_row_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dip" > <com.example.view.DotView android:id="@+id/game_dot_7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" /> <com.example.view.DotView android:id="@+id/game_dot_8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" /> <com.example.dotte.DotView android:id="@+id/game_dot_9" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" /> </TableRow> </TableLayout> </RelativeLayout> This is my LineView class. I use this to try and draw the actual line between the points. public class LineView extends View { Paint paint = new Paint(); float startingX, startingY, endingX, endingY; public LineView(Context context) { super(context); // TODO Auto-generated constructor stub paint.setColor(Color.BLACK); paint.setStrokeWidth(10); } public void setPoints(float startX, float startY, float endX, float endY) { startingX = startX; startingY = startY; endingX = endX; endingY = endY; invalidate(); } @Override public void onDraw(Canvas canvas) { canvas.drawLine(startingX, startingY, endingX, endingY, paint); } } And this is my Activity. public class Game extends Activity { DotView dv1, dv2, dv3, dv4, dv5, dv6, dv7; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_game); getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LOW_PROFILE); findDotIds(); RelativeLayout rl = (RelativeLayout) findViewById(R.id.activity_game_relative_layout); LineView lv = new LineView(this); lv.setPoints(dv1.getLeft(), dv1.getTop(), dv7.getLeft(), dv7.getTop()); rl.addView(lv); // TODO: Get the coordinates of all the dots in the TableLayout. Use view tree observer. } private void findDotIds() { // TODO Auto-generated method stub dv1 = (DotView) findViewById(R.id.game_dot_1); dv2 = (DotView) findViewById(R.id.game_dot_2); dv3 = (DotView) findViewById(R.id.game_dot_3); dv4 = (DotView) findViewById(R.id.game_dot_4); dv5 = (DotView) findViewById(R.id.game_dot_5); dv6 = (DotView) findViewById(R.id.game_dot_6); dv7 = (DotView) findViewById(R.id.game_dot_7); } } The views I want to draw lines between are in the TableLayout.

    Read the article

  • using Unity Android In a sub view and add actionbar and style

    - by aeroxr1
    I exported a simple animation from Unity3D (version 4.5) in android project. With eclipse I modified the manifest and added another activity. In this activity I put a button that it makes start the animation,and this is the result. The action bar appear in the main activity but it doesn't in the unity's activity :( How can I add the action bar and the style of the first activity to unity's animation activity ? This is the unity's activity's code : package com.rabidgremlin.tut.redcube; import android.app.NativeActivity; import android.content.res.Configuration; import android.graphics.PixelFormat; import android.os.Bundle; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import com.unity3d.player.UnityPlayer; public class UnityPlayerNativeActivity extends NativeActivity { protected UnityPlayer mUnityPlayer; // don't change the name of this variable; referenced from native code // Setup activity layout @Override protected void onCreate (Bundle savedInstanceState) { //requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); getWindow().takeSurface(null); //setTheme(android.R.style.Theme_NoTitleBar_Fullscreen); getWindow().setFormat(PixelFormat.RGB_565); mUnityPlayer = new UnityPlayer(this); /*if (mUnityPlayer.getSettings ().getBoolean ("hide_status_bar", true)) getWindow ().setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); */ setContentView(mUnityPlayer); mUnityPlayer.requestFocus(); } // Quit Unity @Override protected void onDestroy () { mUnityPlayer.quit(); super.onDestroy(); } // Pause Unity @Override protected void onPause() { super.onPause(); mUnityPlayer.pause(); } // eliminiamo questa onResume() e proviamo a modificare la onResume() // Resume Unity @Override protected void onResume() { super.onResume(); mUnityPlayer.resume(); } // inseriamo qualche modifica qui // This ensures the layout will be correct. @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mUnityPlayer.configurationChanged(newConfig); } // Notify Unity of the focus change. @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); mUnityPlayer.windowFocusChanged(hasFocus); } // For some reason the multiple keyevent type is not supported by the ndk. // Force event injection by overriding dispatchKeyEvent(). @Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_MULTIPLE) return mUnityPlayer.injectEvent(event); return super.dispatchKeyEvent(event); } // Pass any events not handled by (unfocused) views straight to UnityPlayer @Override public boolean onKeyUp(int keyCode, KeyEvent event) { return mUnityPlayer.injectEvent(event); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { return mUnityPlayer.injectEvent(event); } @Override public boolean onTouchEvent(MotionEvent event) { return mUnityPlayer.injectEvent(event); } /*API12*/ public boolean onGenericMotionEvent(MotionEvent event) { return mUnityPlayer.injectEvent(event); } } And this is the AndroidManifest.xml android:versionCode="1" android:versionName="1.0" > <!-- android:theme="@android:style/Theme.NoTitleBar"--> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" /> <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@android:style/Theme.Holo.Light" > <activity android:name="com.rabidgremlin.tut.redcube.UnityPlayerNativeActivity" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:label="@string/app_name" android:screenOrientation="portrait" > <!--android:launchMode="singleTask"--> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" /> </activity> <activity android:name="com.rabidgremlin.tut.redcube.MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="19" /> <uses-feature android:glEsVersion="0x00020000" /> </manifest>

    Read the article

  • android include tag - invalid layout refernce

    - by Dalibor Frivaldsky
    Hello, I'm having a problem including a different layout through the include tag in the android layout xml file. When specifing the layout reference ( @layout/... ), i'm getting a InflateException in the Eclipse ADT with the following error: InflateException: You must specifiy a valid layout reference. The layout ID @layout/func_edit_simple_calculator_toolbox is not valid. the reference should be valid, as I've selected it from the the list of my other layouts and didnt type it in. I'm using android sdk v2.1 these are the layout files func_edit_simple_calculator_toolbox.xml <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="wrap_content"> <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content"android:layout_height="wrap_content"> <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1"></Button> <Button android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2"></Button> <Button android:id="@+id/Button03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3"></Button> <Button android:id="@+id/Button04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+"></Button> </TableRow> <TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/Button05" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="4"></Button> <Button android:id="@+id/Button06" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="5"></Button> <Button android:id="@+id/Button07" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="6"></Button> <Button android:id="@+id/Button08" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="-"></Button> </TableRow> </TableLayout> function_editor_layout.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" > <com.calculoid.FunctionView android:id="@+id/function_view" android:layout_width="fill_parent" android:layout_height="fill_parent"/> <include android:id="@+id/include01" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/func_edit_simple_calculator_toolbox"></include> </LinearLayout> Does any one know what could be the problem? thanks in advance

    Read the article

  • Android Textview Italic and wrap_contents

    - by Faisal khan
    I am using 3 italic textviews with different colors <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/submittedBy" android:paddingTop="10dip"> <ImageView android:id="@+id/subByImg" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:layout_gravity="bottom" android:src="@drawable/submitted_by_arrow"/> <TextView android:id="@+id/submitLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:text="Submitted by" android:textStyle="italic" android:textSize="12sp" android:textColor="@color/gray" android:paddingLeft="5dip"/> <TextView android:id="@+id/submitName" android:textStyle="italic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="12sp" android:textColor="@color/maroon_dark" android:paddingLeft="10dip"/> <TextView android:id="@+id/submitByDate" android:textStyle="italic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:textSize="12sp" android:textColor="@color/gray" android:paddingLeft="10dip"/> </LinearLayout> I wonder every last character is not displaying properly specially name displayed in the middle is "Dan Buckland" and it it is missing last character looks like "Dan Bucklano" Also tell me pls how can have textview italic and bold both..

    Read the article

  • Problem with Android emulator

    - by benasio
    Projects do not run, on screen emulator only "ANDROID" WinXP pro SP3/Eclipse Galileo java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing) My actions: 1.Start the emulator(Platform:2.1 API Level:7), wait until the window DDMS status will change to ONLINE 2.Launches helloandroid from examples - Run as Android Application Console: Android Launch! [2010-05-03 21:44:34 - HelloAndroid] adb is running normally. [2010-05-03 21:44:34 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch [2010-05-03 21:44:34 - HelloAndroid] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'my_vm' [2010-05-03 21:44:34 - HelloAndroid] WARNING: Application does not specify an API level requirement! [2010-05-03 21:44:34 - HelloAndroid] Device API version is 7 (Android 2.1) [2010-05-03 21:44:34 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554' [2010-05-03 21:44:35 - HelloAndroid] Installing HelloAndroid.apk... [2010-05-03 21:45:07 - HelloAndroid] Success! [2010-05-03 21:45:08 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device [2010-05-03 21:45:28 - HelloAndroid] ActivityManager: DDM dispatch reg wait timeout [2010-05-03 21:45:28 - HelloAndroid] ActivityManager: Can't dispatch DDM chunk 52454151: no handler defined [2010-05-03 21:45:28 - HelloAndroid] ActivityManager: Can't dispatch DDM chunk 48454c4f: no handler defined [2010-05-03 21:45:28 - HelloAndroid] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined [2010-05-03 21:45:28 - HelloAndroid] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined [2010-05-03 21:45:52 - HelloAndroid] Device not ready. Waiting 3 seconds before next attempt. [2010-05-03 21:45:52 - HelloAndroid] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running? [2010-05-03 21:45:55 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device [2010-05-03 21:46:11 - HelloAndroid] ActivityManager: DDM dispatch reg wait timeout ...... DDMS console (only errors and warnings) 05-03 17:43:52.437: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory) 05-03 17:43:52.437: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory) 05-03 17:43:52.437: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory) 05-03 17:43:52.437: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory) 05-03 17:48:34.036: WARN/Zygote(29): Preloaded drawable resource #0x1080093 (res/drawable-mdpi/sym_def_app_icon.png) that varies with configuration!! 05-03 17:48:34.406: WARN/Zygote(29): Preloaded drawable resource #0x1080002 (res/drawable-mdpi/arrow_down_float.png) that varies with configuration!! 05-03 17:48:35.836: WARN/Zygote(29): Preloaded drawable resource #0x10800b4 (res/drawable/btn_check.xml) that varies with configuration!! 05-03 17:48:36.076: WARN/Zygote(29): Preloaded drawable resource #0x10800b7 (res/drawable-mdpi/btn_check_label_background.9.png) that varies with configuration!! 05-03 17:48:36.106: WARN/Zygote(29): Preloaded drawable resource #0x10800b8 (res/drawable-mdpi/btn_check_off.png) that varies with configuration!! 05-03 17:48:36.147: WARN/Zygote(29): Preloaded drawable resource #0x10800bd (res/drawable-mdpi/btn_check_on.png) that varies with configuration!! 05-03 17:48:36.437: WARN/Zygote(29): Preloaded drawable resource #0x1080004 (res/drawable/btn_default.xml) that varies with configuration!! 05-03 17:48:36.716: WARN/Zygote(29): Preloaded drawable resource #0x1080005 (res/drawable/btn_default_small.xml) that varies with configuration!! 05-03 17:48:36.966: WARN/Zygote(29): Preloaded drawable resource #0x1080006 (res/drawable/btn_dropdown.xml) that varies with configuration!! 05-03 17:48:37.326: WARN/Zygote(29): Preloaded drawable resource #0x1080008 (res/drawable/btn_plus.xml) that varies with configuration!! 05-03 17:48:37.707: WARN/Zygote(29): Preloaded drawable resource #0x1080007 (res/drawable/btn_minus.xml) that varies with configuration!! 05-03 17:48:38.057: WARN/Zygote(29): Preloaded drawable resource #0x1080009 (res/drawable/btn_radio.xml) that varies with configuration!! 05-03 17:48:38.776: WARN/Zygote(29): Preloaded drawable resource #0x108000a (res/drawable/btn_star.xml) that varies with configuration!! 05-03 17:48:39.327: WARN/Zygote(29): Preloaded drawable resource #0x1080125 (res/drawable/btn_toggle.xml) that varies with configuration!! 05-03 17:48:39.416: WARN/Zygote(29): Preloaded drawable resource #0x1080187 (res/drawable-mdpi/ic_emergency.png) that varies with configuration!! 05-03 17:48:39.506: WARN/Zygote(29): Preloaded drawable resource #0x1080012 (res/drawable-mdpi/divider_horizontal_bright.9.png) that varies with configuration!! 05-03 17:48:39.576: WARN/Zygote(29): Preloaded drawable resource #0x1080014 (res/drawable-mdpi/divider_horizontal_dark.9.png) that varies with configuration!! 05-03 17:48:40.126: WARN/Zygote(29): Preloaded drawable resource #0x1080016 (res/drawable/edit_text.xml) that varies with configuration!! 05-03 17:48:40.507: WARN/Zygote(29): Preloaded drawable resource #0x1080161 (res/drawable/expander_group.xml) that varies with configuration!! 05-03 17:48:41.036: WARN/Zygote(29): Preloaded drawable resource #0x1080062 (res/drawable/list_selector_background.xml) that varies with configuration!! 05-03 17:48:41.177: WARN/Zygote(29): Preloaded drawable resource #0x1080217 (res/drawable-mdpi/menu_background.9.png) that varies with configuration!! 05-03 17:48:41.256: WARN/Zygote(29): Preloaded drawable resource #0x1080218 (res/drawable-mdpi/menu_background_fill_parent_width.9.png) that varies with configuration!! 05-03 17:48:41.567: WARN/Zygote(29): Preloaded drawable resource #0x1080219 (res/drawable/menu_selector.xml) that varies with configuration!! 05-03 17:48:41.706: WARN/Zygote(29): Preloaded drawable resource #0x1080224 (res/drawable-mdpi/panel_background.9.png) that varies with configuration!! 05-03 17:48:41.849: WARN/Zygote(29): Preloaded drawable resource #0x108022e (res/drawable-mdpi/popup_bottom_bright.9.png) that varies with configuration!! 05-03 17:48:42.026: WARN/Zygote(29): Preloaded drawable resource #0x108022f (res/drawable-mdpi/popup_bottom_dark.9.png) that varies with configuration!! 05-03 17:48:42.156: WARN/Zygote(29): Preloaded drawable resource #0x1080230 (res/drawable-mdpi/popup_bottom_medium.9.png) that varies with configuration!! 05-03 17:48:42.276: WARN/Zygote(29): Preloaded drawable resource #0x1080231 (res/drawable-mdpi/popup_center_bright.9.png) that varies with configuration!! 05-03 17:48:42.376: WARN/Zygote(29): Preloaded drawable resource #0x1080232 (res/drawable-mdpi/popup_center_dark.9.png) that varies with configuration!! 05-03 17:48:42.507: WARN/Zygote(29): Preloaded drawable resource #0x1080235 (res/drawable-mdpi/popup_full_dark.9.png) that varies with configuration!! 05-03 17:48:42.606: WARN/Zygote(29): Preloaded drawable resource #0x1080238 (res/drawable-mdpi/popup_top_bright.9.png) that varies with configuration!! 05-03 17:48:42.696: WARN/Zygote(29): Preloaded drawable resource #0x1080239 (res/drawable-mdpi/popup_top_dark.9.png) that varies with configuration!! 05-03 17:48:42.946: WARN/Zygote(29): Preloaded drawable resource #0x108006d (res/drawable/progress_indeterminate_horizontal.xml) that varies with configuration!! 05-03 17:48:43.076: WARN/Zygote(29): Preloaded drawable resource #0x108023f (res/drawable/progress_small.xml) that varies with configuration!! 05-03 17:48:43.456: WARN/Zygote(29): Preloaded drawable resource #0x1080240 (res/drawable/progress_small_titlebar.xml) that varies with configuration!! 05-03 17:48:43.957: WARN/Zygote(29): Preloaded drawable resource #0x1080262 (res/drawable-mdpi/scrollbar_handle_horizontal.9.png) that varies with configuration!! 05-03 17:48:44.036: WARN/Zygote(29): Preloaded drawable resource #0x1080263 (res/drawable-mdpi/scrollbar_handle_vertical.9.png) that varies with configuration!! 05-03 17:48:44.176: WARN/Zygote(29): Preloaded drawable resource #0x1080071 (res/drawable/spinner_dropdown_background.xml) that varies with configuration!! 05-03 17:48:44.317: WARN/Zygote(29): Preloaded drawable resource #0x1080326 (res/drawable-mdpi/title_bar_shadow.9.png) that varies with configuration!! 05-03 17:48:44.496: WARN/Zygote(29): Preloaded drawable resource #0x10801c6 (res/drawable-mdpi/indicator_code_lock_drag_direction_green_up.png) that varies with configuration!! 05-03 17:48:44.607: WARN/Zygote(29): Preloaded drawable resource #0x10801c7 (res/drawable-mdpi/indicator_code_lock_drag_direction_red_up.png) that varies with configuration!! 05-03 17:48:45.956: WARN/Zygote(29): Preloaded drawable resource #0x10801c8 (res/drawable-mdpi/indicator_code_lock_point_area_default.png) that varies with configuration!! 05-03 17:48:46.407: WARN/Zygote(29): Preloaded drawable resource #0x10801c9 (res/drawable-mdpi/indicator_code_lock_point_area_green.png) that varies with configuration!! 05-03 17:48:46.696: WARN/Zygote(29): Preloaded drawable resource #0x10801ca (res/drawable-mdpi/indicator_code_lock_point_area_red.png) that varies with configuration!! 05-03 17:48:56.307: ERROR/BatteryService(170): usbOnlinePath not found 05-03 17:48:56.336: ERROR/BatteryService(170): batteryVoltagePath not found 05-03 17:48:56.350: ERROR/BatteryService(170): batteryTemperaturePath not found 05-03 17:48:56.696: ERROR/SurfaceFlinger(170): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake 05-03 17:48:57.847: WARN/SurfaceFlinger(170): ro.sf.lcd_density not defined, using 160 dpi by default. 05-03 17:49:02.116: WARN/UsageStats(170): Usage stats version changed; dropping 05-03 17:49:05.036: WARN/zipro(182): Unable to open zip '/data/local/bootanimation.zip': No such file or directory 05-03 17:49:06.297: WARN/zipro(182): Unable to open zip '/system/media/bootanimation.zip': No such file or directory 05-03 17:49:50.637: WARN/PackageManager(170): Running ENG build: no pre-dexopt! 05-03 17:53:59.196: WARN/PackageManager(170): Unknown permission com.google.android.providers.gmail.permission.WRITE_GMAIL in package com.android.settings 05-03 17:53:59.238: WARN/PackageManager(170): Unknown permission com.google.android.providers.gmail.permission.READ_GMAIL in package com.android.settings 05-03 17:53:59.286: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.settings 05-03 17:53:59.517: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.providers.contacts 05-03 17:53:59.656: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.cp in package com.android.providers.contacts 05-03 17:53:59.717: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.contacts 05-03 17:53:59.796: WARN/PackageManager(170): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone 05-03 17:54:00.126: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.development 05-03 17:54:00.206: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES in package com.android.development 05-03 17:54:00.206: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.YouTubeUser in package com.android.development 05-03 17:54:00.237: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD in package com.android.development 05-03 17:54:00.258: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.browser 05-03 17:54:25.456: WARN/ResourceType(170): Resources don't contain package for resource number 0x7f0700e5 05-03 17:54:25.486: WARN/ResourceType(170): Resources don't contain package for resource number 0x7f020031 05-03 17:54:25.536: WARN/ResourceType(170): Resources don't contain package for resource number 0x7f020030 05-03 17:54:25.576: WARN/ResourceType(170): Resources don't contain package for resource number 0x7f050000 05-03 17:54:38.708: WARN/SharedBufferStack(182): waitForCondition(LockCondition) timed out (identity=0, status=0). CPU may be pegged. trying again.

    Read the article

  • Making the Android emulator run faster

    - by hgpc
    The Android emulator is a bit sluggish. For some devices, like the Motorola Droid and the Nexus One, the app runs faster in the actual device than the emulator. This is a problem when testing games and visual effects. How do you make the emulator run as fast as possible? I've been toying with its parameters but haven't found a configuration that shows a noticeable improvement yet.

    Read the article

  • Android Emulator - Cannot get keyboard to display

    - by Ash
    Basically I cannot get the onscreen keyboard to display at all. I've tried every solution I've read to make it appear within my application, and now I've come to the conclusion that it must be the emulator as it isn't appearing when using Messages, writing e-mails etc. I've looked in Language & input within settings and checked Sample Soft Keyboard, rebooted the emulator with no change. Using Android SKD 2.3.3 3.7in WVGA (Nexus One) I'm hoping someone can maybe guess what's going on. Many thanks

    Read the article

  • Android programming. Application stopped unexpectedly.

    - by user277704
    I've just created a prototype of interface for my android app and tried to run it. Unfortunately I get an error that my app has stopped unexpectedly (my reputation doesn't allow me to post images so follow my links): screenshot of error message This is layout mode of editing. Everything looks as I want so there shouldn't be errors: mobileka.freehostia.com/3.png (I can post only one hyperlink...) This is my main.xml code: <code> <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top" android:background="@drawable/back" > <TextView android:id="@+id/score" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text = "@string/scoreT" android:textColor="@string/scoreColor" android:gravity = "left" android:typeface="serif" android:textStyle="bold|italic" android:textSize="16sp" android:paddingLeft = "10px" android:paddingTop="4px"/ <TextView android:id = "@+id/scoreTxt" android:layout_toRightOf="@+id/score" android:textSize="16sp" android:paddingTop = "5px" android:paddingLeft="4px" android:typeface="serif" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" 0" android:textColor="@string/scoreTextColor" android:gravity = "left"/> <TextView android:id = "@+id/scoreSeparator" android:layout_toRightOf="@+id/scoreTxt" android:textSize="16sp" android:paddingTop = "3px" android:paddingLeft="4px" android:typeface="serif" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="|" android:textColor="@string/scoreColor" android:gravity = "left"/> <TextView android:id = "@+id/timerTxt" android:layout_alignParentRight="true" android:textSize="16sp" android:paddingRight="10px" android:paddingTop="4px" android:typeface="serif" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@string/scoreTextColor" android:gravity = "right" android:text="00:00" /> <TextView android:id = "@+id/timer" android:layout_toLeftOf="@+id/timerTxt" android:textColor="@string/scoreColor" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="16sp" android:padding = "3px" android:typeface="serif" android:textStyle="bold|italic" android:text="@string/timerT" android:gravity = "left"/> <TextView android:id = "@+id/timerSeparator" android:layout_toLeftOf="@+id/timer" android:textSize="16sp" android:paddingTop = "3px" android:paddingLeft="4px" android:typeface="serif" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="|" android:textColor="@string/scoreColor" android:gravity = "left"/> <ImageButton android:id="@+id/buttonOne" android:layout_below="@+id/score" android:layout_marginTop="40px" android:layout_marginLeft="14px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/inactive"/> <ImageButton android:id="@+id/buttonTwo" android:layout_toRightOf="@+id/buttonOne" android:layout_marginTop="63px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonThree" android:layout_toRightOf="@+id/buttonTwo" android:layout_marginTop="63px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonFour" android:layout_toRightOf="@+id/buttonThree" android:layout_marginTop="63px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonFive" android:layout_below="@+id/buttonOne" android:layout_marginTop="40px" android:layout_marginLeft="14px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonSix" android:layout_toRightOf="@+id/buttonFive" android:layout_marginTop="164px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonSeven" android:layout_toRightOf="@+id/buttonSix" android:layout_marginTop="164px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonEight" android:layout_toRightOf="@+id/buttonSeven" android:layout_marginTop="164px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonNine" android:layout_below="@+id/buttonEight" android:layout_marginTop="40px" android:layout_marginLeft="14px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonTen" android:layout_toRightOf="@+id/buttonNine" android:layout_marginTop="264px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonEleven" android:layout_toRightOf="@+id/buttonTen" android:layout_marginTop="264px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonTwelve" android:layout_toRightOf="@+id/buttonEleven" android:layout_marginTop="264px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> And this is my logcat errors (p.s. line #12 is the first TextView in main.xml): 03-26 22:59:31.670: WARN/dalvikvm(185): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 03-26 22:59:31.727: ERROR/AndroidRuntime(185): Uncaught handler: thread main exiting due to uncaught exception 03-26 22:59:31.784: ERROR/AndroidRuntime(185): java.lang.RuntimeException: Unable to start activity ComponentInfo{kz.androidmarket.www.randomtest1/kz.androidmarket.www.randomtest1.randomTest1}: android.view.InflateException: Binary XML file line #12: Error inflating class 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.os.Handler.dispatchMessage(Handler.java:99) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.os.Looper.loop(Looper.java:123) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.main(ActivityThread.java:4363) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at java.lang.reflect.Method.invokeNative(Native Method) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at java.lang.reflect.Method.invoke(Method.java:521) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at dalvik.system.NativeStart.main(Native Method) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.createView(LayoutInflater.java:513) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.Activity.setContentView(Activity.java:1622) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at kz.androidmarket.www.randomtest1.randomTest1.onCreate(randomTest1.java:11) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): ... 11 more 03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: java.lang.reflect.InvocationTargetException 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.widget.TextView.(TextView.java:320) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at java.lang.reflect.Constructor.constructNative(Native Method) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at java.lang.reflect.Constructor.newInstance(Constructor.java:446) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.createView(LayoutInflater.java:500) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): ... 22 more 03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.content.res.Resources$NotFoundException: File #ffff9900 from drawable resource ID #0x7f040002: .xml extension required 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.content.res.Resources.loadColorStateList(Resources.java:1820) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.content.res.TypedArray.getColorStateList(TypedArray.java:289) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.widget.TextView.(TextView.java:627) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): ... 26 more Could anybody help me?

    Read the article

  • clear nootification [android]

    - by rahul
    hiiii, is it possible to clear notification programatically??? if it is possible plz help me i tried with NotificationManager but its not working is thr any other way i can do it?????????? thanks

    Read the article

  • Compiling OpenCV in Android NDK

    - by evident
    PLEASE SEE THE ADDITIONS AT THE BOTTOM! The first problem is solved in Linux, not under Windows and Cygwin yet, but there is a new problem. Please see below! I am currently trying to compile OpenCV for Android NDK so that I can use it in my apps. For this I tried to follow this guide: http://www.stanford.edu/~zxwang/android_opencv.html But when compiling the downloaded stuff with ndk-build I get this error: $ /cygdrive/u/flori/workspace/android-ndk-r5b/ndk-build Compile++ thumb : opencv <= cvjni.cpp Compile++ thumb : cxcore <= cxalloc.cpp Compile++ thumb : cxcore <= cxarithm.cpp Compile++ thumb : cxcore <= cxarray.cpp Compile++ thumb : cxcore <= cxcmp.cpp Compile++ thumb : cxcore <= cxconvert.cpp Compile++ thumb : cxcore <= cxcopy.cpp Compile++ thumb : cxcore <= cxdatastructs.cpp Compile++ thumb : cxcore <= cxdrawing.cpp Compile++ thumb : cxcore <= cxdxt.cpp Compile++ thumb : cxcore <= cxerror.cpp Compile++ thumb : cxcore <= cximage.cpp Compile++ thumb : cxcore <= cxjacobieigens.cpp Compile++ thumb : cxcore <= cxlogic.cpp Compile++ thumb : cxcore <= cxlut.cpp Compile++ thumb : cxcore <= cxmathfuncs.cpp Compile++ thumb : cxcore <= cxmatmul.cpp Compile++ thumb : cxcore <= cxmatrix.cpp Compile++ thumb : cxcore <= cxmean.cpp Compile++ thumb : cxcore <= cxmeansdv.cpp Compile++ thumb : cxcore <= cxminmaxloc.cpp Compile++ thumb : cxcore <= cxnorm.cpp Compile++ thumb : cxcore <= cxouttext.cpp Compile++ thumb : cxcore <= cxpersistence.cpp Compile++ thumb : cxcore <= cxprecomp.cpp Compile++ thumb : cxcore <= cxrand.cpp Compile++ thumb : cxcore <= cxsumpixels.cpp Compile++ thumb : cxcore <= cxsvd.cpp Compile++ thumb : cxcore <= cxswitcher.cpp Compile++ thumb : cxcore <= cxtables.cpp Compile++ thumb : cxcore <= cxutils.cpp StaticLibrary : libstdc++.a StaticLibrary : libcxcore.a Compile++ thumb : cv <= cvaccum.cpp Compile++ thumb : cv <= cvadapthresh.cpp Compile++ thumb : cv <= cvapprox.cpp Compile++ thumb : cv <= cvcalccontrasthistogram.cpp Compile++ thumb : cv <= cvcalcimagehomography.cpp Compile++ thumb : cv <= cvcalibinit.cpp Compile++ thumb : cv <= cvcalibration.cpp Compile++ thumb : cv <= cvcamshift.cpp Compile++ thumb : cv <= cvcanny.cpp Compile++ thumb : cv <= cvcolor.cpp Compile++ thumb : cv <= cvcondens.cpp Compile++ thumb : cv <= cvcontours.cpp Compile++ thumb : cv <= cvcontourtree.cpp Compile++ thumb : cv <= cvconvhull.cpp Compile++ thumb : cv <= cvcorner.cpp Compile++ thumb : cv <= cvcornersubpix.cpp Compile++ thumb : cv <= cvderiv.cpp Compile++ thumb : cv <= cvdistransform.cpp Compile++ thumb : cv <= cvdominants.cpp Compile++ thumb : cv <= cvemd.cpp Compile++ thumb : cv <= cvfeatureselect.cpp Compile++ thumb : cv <= cvfilter.cpp Compile++ thumb : cv <= cvfloodfill.cpp Compile++ thumb : cv <= cvfundam.cpp Compile++ thumb : cv <= cvgeometry.cpp Compile++ thumb : cv <= cvhaar.cpp Compile++ thumb : cv <= cvhistogram.cpp Compile++ thumb : cv <= cvhough.cpp Compile++ thumb : cv <= cvimgwarp.cpp Compile++ thumb : cv <= cvinpaint.cpp Compile++ thumb : cv <= cvkalman.cpp Compile++ thumb : cv <= cvlinefit.cpp Compile++ thumb : cv <= cvlkpyramid.cpp Compile++ thumb : cv <= cvmatchcontours.cpp Compile++ thumb : cv <= cvmoments.cpp Compile++ thumb : cv <= cvmorph.cpp Compile++ thumb : cv <= cvmotempl.cpp Compile++ thumb : cv <= cvoptflowbm.cpp Compile++ thumb : cv <= cvoptflowhs.cpp Compile++ thumb : cv <= cvoptflowlk.cpp Compile++ thumb : cv <= cvpgh.cpp Compile++ thumb : cv <= cvposit.cpp Compile++ thumb : cv <= cvprecomp.cpp Compile++ thumb : cv <= cvpyramids.cpp Compile++ thumb : cv <= cvpyrsegmentation.cpp Compile++ thumb : cv <= cvrotcalipers.cpp Compile++ thumb : cv <= cvsamplers.cpp Compile++ thumb : cv <= cvsegmentation.cpp Compile++ thumb : cv <= cvshapedescr.cpp Compile++ thumb : cv <= cvsmooth.cpp Compile++ thumb : cv <= cvsnakes.cpp Compile++ thumb : cv <= cvstereobm.cpp Compile++ thumb : cv <= cvstereogc.cpp Compile++ thumb : cv <= cvsubdivision2d.cpp Compile++ thumb : cv <= cvsumpixels.cpp Compile++ thumb : cv <= cvsurf.cpp Compile++ thumb : cv <= cvswitcher.cpp Compile++ thumb : cv <= cvtables.cpp Compile++ thumb : cv <= cvtemplmatch.cpp Compile++ thumb : cv <= cvthresh.cpp Compile++ thumb : cv <= cvundistort.cpp Compile++ thumb : cv <= cvutils.cpp StaticLibrary : libcv.a SharedLibrary : libopencv.so U:/flori/workspace/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebui lt/windows/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-andr oideabi/bin/ld.exe: cannot find -lcxcore collect2: ld returned 1 exit status make: *** [/cygdrive/u/flori/workspace/android/testOpenCV/obj/local/armeabi/libo pencv.so] Error 1 I am trying to compile it on a Windows system and with the newest NDK version... Does anybody have an idea what this linking error means and what I can to to have it work again? Would be great if anybody could help After getting the problem to work I found that there is another way of compiling OpenCV for Android, using the current version of OpenCV (instead of the 1.1 one from above) and the modified Android NDK from crystax, which supports STL and exceptions and therefore supports the newest OpenCV Version. All information on that can be found here: http://opencv.willowgarage.com/wiki/Android There it says to download the current svn trunk and the crystax-r4 android-ndk, as well as swig, which I did. I entered the folder, created the build directory, ran cmake and then built the static libs, which seemed to work. At least it successfully ran the make-command without errors. I now wanted to build the shared libraries so I entered the android-jni folder and ran 'make' again, but got this error: % make -j4 OPENCV_CONFIG = ../build/android-opencv.mk make clean-swig &&\ mkdir -p jni/gen &&\ mkdir -p src/com/opencv/jni &&\ swig -java -c++ -package "com.opencv.jni" \ -outdir src/com/opencv/jni \ -o jni/gen/android_cv_wrap.cpp jni/android-cv.i OPENCV_CONFIG = ../build/android-opencv.mk make[1]: Entering directory `/home/florian/android-opencv-willowgarage/android/android-jni' make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. rm -f jni/gen/android_cv_wrap.cpp make[1]: Leaving directory `/home/florian/android-opencv-willowgarage/android/android-jni' /home/florian/android-ndk-r4-crystax/ndk-build OPENCV_CONFIG=../build/android-opencv.mk \ PROJECT_PATH= ARM_TARGETS="armeabi armeabi-v7a" V= /home/florian/android-ndk-r4-crystax/ndk-build OPENCV_CONFIG=../build/android-opencv.mk \ PROJECT_PATH= ARM_TARGETS="armeabi armeabi-v7a" V= make[1]: Entering directory `/home/florian/android-opencv-willowgarage/android/android-jni' /home/florian/android-opencv-willowgarage/android/android-jni/jni/Android.mk:10: ../build/android-opencv.mk: No such file or directory make[1]: Entering directory `/home/florian/android-opencv-willowgarage/android/android-jni' /home/florian/android-opencv-willowgarage/android/android-jni/jni/Android.mk:10: ../build/android-opencv.mk: No such file or directory /home/florian/android-opencv-willowgarage/android/android-jni/jni/Android.mk:10: ../build/android-opencv.mk: No such file or directory make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. /home/florian/android-opencv-willowgarage/android/android-jni/jni/Android.mk:10: ../build/android-opencv.mk: No such file or directory make[1]: *** No rule to make target `../build/android-opencv.mk'. Stop. make[1]: Leaving directory `/home/florian/android-opencv-willowgarage/android/android-jni' make: *** [libs/armeabi/libandroid-opencv.so] Error 2 make: *** Waiting for unfinished jobs.... make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. make[1]: *** No rule to make target `../build/android-opencv.mk'. Stop. make[1]: Leaving directory `/home/florian/android-opencv-willowgarage/android/android-jni' make: *** [libs/armeabi-v7a/libandroid-opencv.so] Error 2 Does anybody have an idea what this means and what I can do to build the shared libraries? ... Ok after having a look at the error message it came to me that it seems to have something missing in the build directory... but there wasn't even a build directory in the android folder so I created one, ran 'cmake' in there and 'make' again but get this error: Compile thumb : opencv_lapack <= /home/florian/android-opencv-willowgarage/3rdparty/lapack/sgetrf.c Compile thumb : opencv_lapack <= /home/florian/android-opencv-willowgarage/3rdparty/lapack/scopy.c Compile++ thumb: opencv_core <= /home/florian/android-opencv-willowgarage/modules/core/src/matrix.cpp cc1plus: error: /home/florian/android-opencv-willowgarage/android/../modules/index.rst/include: Not a directory make[3]: *** [/home/florian/android-opencv-willowgarage/android/build/obj/local/armeabi/objs/opencv_core/src/matrix.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [android-opencv] Error 2 make[1]: *** [CMakeFiles/ndk.dir/all] Error 2 make: *** [all] Error 2 Anybody know what this means?

    Read the article

  • Android: Autoscrolling HorizontalScrollView

    - by DroidIn.net
    I'm using the following code to simulate tabs and since there are more tabs that width can accommodate user can scroll left or right to make a tab button visible. It all works, however I also provide user with ability to fling between tabs by swiping finger left or right on the tab contents. Again - it works. But when I fling to the rightmost tab its corresponding button is barely visible. I want to autoscroll table inside the HorizontalScrollView so the selected tab button will be visible but when I execute HorizontalScrollView.smoothScrollTo(300, 0) nothing happens. It doen't matter how high I set first x parameter nothing will ever move (yes I do have an algorithm to calculate exact position). Here's XML code for scrolling tab buttons <HorizontalScrollView android:layout_width="fill_parent" android:background="@color/tabs_header" android:layout_height="55dip" android:scrollbars="none" android:id="@+id/tabsButtonView"> <TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableRow android:id="@+id/TableRow01" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="0dip" android:paddingTop="5dip" android:paddingLeft="3dip"> <ImageButton android:src="@drawable/linkup_logo_small" android:id="@+id/tabBtt0" android:layout_width="wrap_content" android:layout_marginLeft="2dip" android:layout_marginRight="2dip" android:layout_height="fill_parent" android:padding="5dip" android:background="@drawable/tab_selected"></ImageButton> <ImageButton android:src="@drawable/simplyhired_small" android:id="@+id/tabBtt1" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_marginLeft="2dip" android:layout_marginRight="2dip" android:padding="5dip" android:background="@drawable/tab_normal"></ImageButton> <ImageButton android:src="@drawable/indeedcom_small" android:id="@+id/tabBtt2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dip" android:layout_marginLeft="2dip" android:layout_marginRight="2dip" android:background="@drawable/tab_normal"></ImageButton> <ImageButton android:src="@drawable/careerbuilder_logo_small" android:id="@+id/tabBtt3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dip" android:layout_marginLeft="2dip" android:layout_marginRight="2dip" android:background="@drawable/tab_normal"></ImageButton> </TableRow> </TableLayout> </HorizontalScrollView>

    Read the article

  • How to set an EditText on top of a ListView ?

    - by Spredzy
    Hi everyone, I am trying to do an autocomplete version my way (logic, layout, etc...) , so I don't want to use the AutoCompleteTextView. My question is how to set an EditText on top of a ListView in a class inheriting from a ListAcvitivy. I tried two kinds of layout, none of them worked. First one : <EditText android:id="@+id/autocomplete_server" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:completionThreshold="1" android:singleLine="true"/> <ListView android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" android:layout_weight="1" android:drawSelectorOnTop="false"/> <TextView android:id="@id/android:empty" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FF0000" android:text="No data"/> This one only shows me the EditText but does not display the list Second one : <LinearLayout android:id="@id/android:list" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5dp"> <EditText android:id="@+id/autocomplete_server" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:completionThreshold="1" android:singleLine="true"/> <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" android:layout_weight="1" android:drawSelectorOnTop="false"/> </LinearLayout> This sample gives me a : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eip.core/com.eip.core.Search}: java.lang.ClassCastException: android.widget.LinearLayout Does anyone have any idea bout how to implement an EditText on top of a listView ?

    Read the article

  • Android Home Screen Widget (icon, label - style)

    - by dmulligan
    I'm trying to create an icon/widget (1 cell x 1 cell) that can be placed on the home screen of android. The widget will look and act exactly like the other standard shortcuts in android. It will have an icon and under that a label, it will be selectable with the trackball (highlight able) it will be highlighted when it is selected/clicked. How do I go about creating this home screen widget? Do I have to create the widget myself using code/xml or is there some standard xml, style, theme, code that I can use to ensure that the widget will have the same style/theme as the other home screen widgets? I currently have the following res/drawable/corners.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/Corners"> <stroke android:width="4dp" android:color="#CC222222" /> <padding android:left="4dp" android:top="1dp" android:right="4dp" android:bottom="1dp" /> <corners android:radius="4dp" /> </shape> res/layout/widget.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/Widget" android:layout_width="72dip" android:layout_height="72dip" android:orientation="vertical" android:focusable="true" android:gravity="center_horizontal" style="@android:style/Widget" > <ImageView android:id="@+id/WidgetIcon" android:src="@drawable/icon" android:layout_width="fill_parent" android:layout_height="50dip" android:paddingTop="3dip" android:gravity="center" /> <TextView android:id="@+id/WidgetLabel" android:layout_width="wrap_content" android:layout_height="fill_parent" android:text="@string/app_name" android:textSize="15dip" android:background="@drawable/corners" /> </LinearLayout> The resulting widget looks some what close, but its not selectable, it doesn't get highlighted when clicked and the label isn't exactly in the correct location or the correct style. Any ideas, if there is a correct way to do this, or should I just keep working away on the above until I am closer?

    Read the article

  • Contact-app like scrollinglist on android

    - by Alxandr
    I'm writing my first android app (I'm a noob at android, but decent at java). The first screen of the app consists of a huge list (about 1.5K items) of Manga-objects. The code I use is as following: main.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <ListView android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/android:list"></ListView> <TextView android:layout_height="fill_parent" android:layout_width="fill_parent" android:text="@string/list_no_items" android:id="@+id/android:empty"></TextView> </LinearLayout> row.xml: <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:padding="6dip" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="6dip" android:src="@drawable/icon" /> <LinearLayout android:orientation="vertical" android:layout_width="0dip" android:layout_weight="1" android:layout_height="fill_parent"> <TextView android:id="@+id/toptext" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center_vertical" /> <TextView android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:id="@+id/bottomtext" android:singleLine="true" android:ellipsize="marquee" /> </LinearLayout> </LinearLayout> Then I have a adapter which basically takes a Manga-object and puts it's name in the rows toptext, and it's latest updated date in the bottomtext. However, (this might be caused by the virtualization of the unit though), the result is really slow. Scrolling the list takes forever and you can only scroll small peaces of the time. How can I make the list work like the one in the contacts-app? So that when you start scrolling a handle pops out at the right side of the screen, and when you drag it letters shows up as of how far you've scrolled (the list is sorted alphabetically), and also, is there a way I could improve the performance of the list?

    Read the article

  • Android: onClick on LinearLayout with TextView and Button

    - by Terry
    I have a Fragment that uses the following XML layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/card" android:clickable="true" android:onClick="editActions" android:orientation="vertical" > <TextView android:id="@+id/title" style="@style/CardTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:duplicateParentState="true" android:text="@string/title_workstation" /> <Button android:id="@+id/factory_button_edit" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:duplicateParentState="true" android:text="@string/label_edit" /> </LinearLayout> As you can see, I have an onClick parameter set on LinearLayout. Now on the TextView this one is triggered correctly, and on all empty area. Just on the Button it doesn't invoke the onClick method that I set. Is this normal? What do I have to do so that the onClick method is invoked everywhere on the LinearLayout?

    Read the article

  • My app has some basic problems, and it stops working

    - by user2882662
    I am writing a basic application which contains two activities. Both contain a TextView showing the title and the first one contains an EditText in which the user types a message and clicks on a button on its side, the second activity is launched which shows the message the user types. It has the following problems: The title (the first TextView in both the activities) doesn't show in the middle of the line, despite of the android:gravity="center_horizontal" attribute. The EditText in the first activity does not show at all. When I click on the button, the app stops saying "Unfortunately Write n Display and stopped.", rather than launching the second activity at all. I don't have adequate knowledge about logcat, but I have followed the steps somebody had told me, that is WindowOpen Perspective Other DDMS Then run the app and select the package name from the Devices and click on log cat, select the exception(s) and export to text file. All contained in the text file is : : E/(): Device disconnected: 1 Since I am not sure of using log cat, so I am posting a screenshot to make clear what I have done. CODE OF FIRST ACTIVITY: - package com.practice.myfirstapp1; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.EditText; //import android.view.Menu; public class MainActivity extends Activity { public static final String key_name="com.practice.firstApp.key"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } private void sendMessage(View view){ Intent intent= new Intent(this, SecondActivity.class); EditText editText=(EditText) findViewById(R.id.EditText1_MainActivity); String key_value= editText.getText().toString(); intent.putExtra(key_name, key_value); startActivity(intent); } } LAYOUT OF FIRST ACTIVITY: - <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <TextView android:id="@+id/TextView1_MainActivity" android:layout_alignParentTop="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@+string/title_MainActivity" android:gravity="center_horizontal" android:textStyle="bold"/> <EditText android:id="@+id/EditText1_MainActivity" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_below="@+id/TextView1_MainActivity" android:hint="@string/EditText_MainActivity" android:textStyle="italic" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/TextView1_MainActivity" android:layout_toRightOf="@id/EditText1_MainActivity" android:text="@string/Button_MainActivity" android:onClick="sendMessage"/> </RelativeLayout> CODE OF SECOND ACTIVITY: - package com.practice.myfirstapp1; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; class SecondActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); Intent intent= getIntent(); String intent_value= intent.getStringExtra(MainActivity.key_name); TextView textView= new TextView(this); textView= (TextView) findViewById(R.id.TextView2_SecondActivity); textView.setText(intent_value); } } LAYOUT OF SECOND ACTIVITY: - <?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="match_parent" android:layout_height="match_parent" android:orientation="horizontal" tools:context=".SecondActivity"> <TextView android:layout_alignParentTop="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@+string/title_SecondActivity" android:gravity="center_horizontal" android:textStyle="bold"/> <TextView android:id="@+id/TextView2_SecondActivity" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout> STRINGS RESOURCE FILE:- <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Write n Display</string> <string name="action_settings">Settings</string> <string name="title_MainActivity">WRITE</string> <string name="EditText_MainActivity">Your Message here</string> <string name="Button_MainActivity">Send</string> <string name="title_SecondActivity">DISPLAY</string> </resources> ANDROID MANIFEST FILE: - <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.practice.myfirstapp1" 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" android:debuggable="true" > <activity android:name="com.practice.myfirstapp1.MainActivity" 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="com.practive.myfirstapp1.SecondActivity" android:label="@string/app_name"> </activity> </application> </manifest>

    Read the article

  • Eclipse will not show 2.3 emulator for android compatibility package code

    - by Mark Lasby
    I am trying to learn fragments to modernize an app I originally wrote for android 1.5 that uses Date Picker Dialog. I am using the android-support-v4 library. When I run the code in Eclipse Juno 20120614-1722 it only shows android 4.0 emulators and there is a red X beside my Samsung phone running 2.3.5. When I push the package to phone, the code runs. Here is the code FragTestActivity.java package xyz.marklasby.fragtest; import java.text.SimpleDateFormat; import java.util.Calendar; import android.app.DatePickerDialog; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentActivity; import android.view.View; import android.widget.Button; import android.widget.DatePicker; public class FragTestActivity extends FragmentActivity { private Button date; private Calendar now; private SimpleDateFormat sdf = new SimpleDateFormat(" EEE MMM dd/yyyy"); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); date = (Button) findViewById(R.id.setdate); now = Calendar.getInstance(); date.setText(sdf.format(now.getTime())); date.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { editDate(v); } }); } public void editDate(View v) { DialogFragment newFragment = DatePickerFragment.newInstance(new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { now.set(year, monthOfYear, dayOfMonth); date.setText(sdf.format(now.getTime())); } }); newFragment.show(getSupportFragmentManager(), "datePicker"); } } DatePickerFragment.java package xyz.marklasby.fragtest; import java.util.Calendar; import android.app.DatePickerDialog; import android.app.Dialog; import android.os.Bundle; import android.support.v4.app.DialogFragment; public class DatePickerFragment extends DialogFragment { static DatePickerDialog.OnDateSetListener mListener; public static DatePickerFragment newInstance(DatePickerDialog.OnDateSetListener listener) { mListener = listener; return new DatePickerFragment(); } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { final Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); return new DatePickerDialog(getActivity(), mListener, year, month, day); } } Manifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xyz.marklasby.fragtest" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".FragTestActivity" android:label="@string/title_activity_frag_test" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> What am I doing wrong?

    Read the article

  • How to align Buttons in a TableLayout to different directions?

    - by Bevor
    Hello, probably I don't understand the layout properties of TableLayout yet. It doesn't seem to be possible to achieve such a flexible table like in HTML, because there are no cells. My target is it to achieve such a layout: Link to draft How can I do that? I thought about using a GridView but this doesn't seem to be useful in XML. My efforts look like this: <TableLayout android:id="@+id/tableLayout" android:layout_width="320sp" android:layout_height="fill_parent" android:layout_gravity="center_horizontal" android:gravity="bottom" android:layout_alignParentBottom="true"> <TableRow android:background="#333333" android:gravity="bottom" android:layout_width="fill_parent"> <Button android:id="@+id/btnUp" android:layout_width="60sp" android:layout_height="50sp" android:gravity="left" android:text="Lift U" /> <Button android:id="@+id/btnScreenUp" android:gravity="right" android:layout_gravity="right" android:layout_width="60sp" android:layout_height="50sp" android:text="Scrn U" /> </TableRow> <TableRow android:background="#444444" android:gravity="bottom" android:layout_gravity="right"> <Button android:id="@+id/btnDown" android:layout_width="60sp" android:layout_height="50sp" android:text="Lift D" /> <Button android:id="@+id/btnScreenLeft" android:layout_width="60sp" android:layout_height="50sp" android:gravity="right" android:layout_gravity="right" android:text="Scrn L" /> <Button android:id="@+id/btnScreenDown" android:layout_width="60sp" android:layout_height="50sp" android:gravity="right" android:layout_gravity="right" android:text="Scrn D" /> <Button android:id="@+id/btnScreenRight" android:layout_width="60sp" android:layout_height="50sp" android:gravity="right" android:layout_gravity="right" android:text="Scrn R" /> </TableRow> </TableLayout>

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >