Search Results

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

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

  • 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

  • Android HTTPClient not working inspite of giving permissions in manifest file.

    - by primal
    Hi, I was trying http-cleint tutorials from svn.apache.org. While running the application I am getting the following error in console. [2010-04-30 09:26:36 - HalloAndroid] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.org.example/.HalloAndroid } from null (pid=-1, uid=-1) requires android.permission.INTERNET I have added android.permission.INTERNET in AndroidManifest.xml. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.org.example" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HalloAndroid" android:label="@string/app_name" android:permission="android.permission.INTERNET"> <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> </manifest> The java code in HalloAndroid.java is as follows HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget2 = new HttpGet("http://google.com/"); HttpResponse response2 = null; try { response2 = httpclient.execute(httpget2); } catch (ClientProtocolException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } HttpEntity entity = response2.getEntity(); if (entity != null) { long len = entity.getContentLength(); if (len != -1 && len < 2048) { try { Log.d(TAG, EntityUtils.toString(entity)); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { // Stream content out } Any help is much appreciated.

    Read the article

  • NotFoundException in layout editor for Android?

    - by borg17of20
    I'm trying to extend a RelativeLayout object and include an embedded SurfaceView object that uses a png file in my /res/drawable folder as its background but I keep getting an error in the XML Layout editor. See the following code: public class StopMotionRelativeLayout extends RelativeLayout { private Context myContext; private SurfaceView surfaceView1; private BitmapFactory.Options myBitmapOptions; private final android.view.ViewGroup.LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.FILL_PARENT); public StopMotionRelativeLayout(Context context, AttributeSet attrs) { super(context, attrs); myContext = context; this.setBackgroundColor(Color.GREEN); //init images surfaceView1 = new SurfaceView(myContext,attrs); surfaceView1.setVisibility(View.INVISIBLE); this.addView(surfaceView1, params); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); myBitmapOptions = new Options(); myBitmapOptions.outWidth = widthMeasureSpec; myBitmapOptions.outHeight = heightMeasureSpec; surfaceView1.setBackgroundDrawable(new BitmapDrawable(BitmapFactory.decodeResource(this.myContext.getResources(), R.drawable.golf1, myBitmapOptions))); } } I get the following error: NotFoundException: Could not find drawable resource matching value 0x7F020002 (resolved name: golf1) in current configuration. I have seen this type of error may times now and it always happens when I try to load something from a resource file via code and not XML. Curiously, this error does not stop me from compiling the app, and the app runs without error in the emulator. I'd like to get back the use of my layout editor though... Please help. UPDATE: Here is the layout XML <?xml version="1.0" encoding="utf-8"?> <com.games.test.StopMotionRelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> </com.games.test.StopMotionRelativeLayout>

    Read the article

  • TableLayout formatting loss after device rotation

    - by roundhill
    I'm seeing a strange issue with a TableLayout after the device is rotated from either orientation. If you load the view in either portrait or landscape mode, the table loads fine. But once you rotate the device, the columns collapse to just fit their width. I would expect that after rotation, the columns would still stretch to fit the width of the screen. Any ideas on what can be done to resolve this? Screenies and layout code below. Before Rotation: After Rotation: Table Layout: <TableLayout android:id="@+id/dataTable" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:layout_below="@id/chart" android:stretchColumns="*" android:shrinkColumns="*" android:padding="6dip" > </TableLayout> Table Row: <TableRow xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/col1" android:layout_marginRight="2dip" android:textColorLink="#FF21759b" android:text="Column 1" android:padding="4dip" android:textColor="#FF464646"/> <TextView android:id="@+id/col2" android:text="Column 2" android:textColor="#FF464646" android:padding="4dip"/> </TableRow> Thanks!

    Read the article

  • Admob in xml not showing in Linear

    - by NoobMe
    i am implementing admob on my app it appears when the parent is in relative layout but i must not use the alignparentbottom so i am changing it to linear but it doesnt show when i change it to linear.. any tips? help? thanks in advance here it is in xml: <?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:orientation="vertical" > <RelativeLayout android:id="@+id/banner_holder" android:layout_width="match_parent" android:layout_height="wrap_content" > <ImageView android:id="@+id/offline_banner" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" android:background="@color/black" android:src="@drawable/offline_banner" /> <com.google.ads.AdView xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" ads:adSize="SMART_BANNER" ads:adUnitId="@string/unit_id" ads:loadAdOnCreate="true" /> </RelativeLayout> <FrameLayout android:id="@+id/fragmentContainer" android:layout_width="match_parent" android:layout_height="wrap_content" /> </LinearLayout> i want the admob to be at the bottom part of the screen without using the alignparentbottom of relative layout thanks~

    Read the article

  • Android AppWidget TextView: How to set background color programmaticly

    - by Amit
    I am trying to create an AppWidget, in which the background color of a TextView changes at random at specified periodic interval. The TextView is defined in layout xml file as <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/message" android:background="#ff99ff" android:text="Hello Widget" /> </LinearLayout> In update method, i have loaded the layout as RemoteViews remoteView=new RemoteViews(context.getPackageName(),R.layout.widget_message); To change the background of TextView i used the following statement remoteView.setInt(R.id.message, "setBackgroundResource", R.color.col_1); But i am getting a widget saying problem loading widget. If i remove the above line everything works fine. LogCat says: updateAppWidget couldn't find any view, using error view android.widget.RemoteViews$ActionException: view: android.widget.TextView can't use method with RemoteViews: setBackgroundResource(int)

    Read the article

  • GridView row remove and animation - Android

    - by Pria
    I have a GridView in which each row has a custom view. The grid view adapter has an array that keeps the custom view. At click of a button, I want to remove a specific row from the Grid and while doing so I want animation on it. I have an AnimationListener. When I remove the upper most row from the array and setAdapter in onAnimationEnd(). It works perfectly fine. But, when I remove any other row, it gives a NullPointerException in the main thread. The exception thread is as follows: ERROR/AndroidRuntime(11503): java.lang.NullPointerException at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1227) at android.widget.AbsListView.dispatchDraw(AbsListView.java:1319) at android.view.View.draw(View.java:5944) at android.widget.AbsListView.draw(AbsListView.java:2121) at android.view.ViewGroup.drawChild(ViewGroup.java:1486) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) at android.view.View.draw(View.java:5841) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1486) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) at android.view.View.draw(View.java:5841) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1486) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) at android.view.View.draw(View.java:5841) at android.widget.FrameLayout.draw(FrameLayout.java:352) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1847) at android.view.ViewRoot.draw(ViewRoot.java:1217) at android.view.ViewRoot.performTraversals(ViewRoot.java:1030) at android.view.ViewRoot.handleMessage(ViewRoot.java:1482) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:3948) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) at dalvik.system.NativeStart.main(Native Method) Please help!!!

    Read the article

  • Why can't Android find android.graphics.OpenGLContext?

    - by lostInTransit
    I am trying to compile some OpenGL samples available on the net in SDK 1.5. But the import statement for android.graphics.OpenGLContext gives me an error saying the class cannot be found. Can someone please tell me where I can find this class. And if it is no longer supported by the android SDK then how do I port the samples to 1.5.

    Read the article

  • Android AppWidget TextView: How to set background color at run time

    - by Amit
    I am trying to create an AppWidget, in which the background color of a TextView changes at random at specified periodic interval. The TextView is defined in layout xml file as <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/message" android:background="#ff99ff" android:text="Hello Widget" /> </LinearLayout> In update method, i have loaded the layout as RemoteViews remoteView=new RemoteViews(context.getPackageName(),R.layout.widget_message); To change the background of TextView i used the following statement remoteView.setInt(R.id.message, "setBackgroundResource", R.color.col_1); But i am getting a widget saying problem loading widget. If i remove the above line everything works fine. LogCat says: updateAppWidget couldn't find any view, using error view android.widget.RemoteViews$ActionException: view: android.widget.TextView can't use method with RemoteViews: setBackgroundResource(int)

    Read the article

  • Android crashes when calling ImageButton

    - by Joël
    I have a crash (Application Stopped Unexpectedly) problem with this main.xml is a "HelloWorld" type project (while testing and learning features I need for my app) : I isolated the ImageButton as an issue, but I can't isolate any of the parameters... <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageButton android:id="@+id/picture" android:layout_width="240dip" android:layout_height="180dip" android:layout_gravity="center_horizontal" android:src="@drawable/icon" android:adjustViewBounds="true" android:cropToPadding="true" android:clickable="true" android:scaleType="fitCenter" /> </LinearLayout> icon.png exists in my resources... I can see the preview in the Layout tab, even though the image is not centered on the button, but I read that it was normal. The code below works fine (as a regular Button). I can also do the same as an ImageView. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:id="@+id/picture" android:layout_width="240dip" android:layout_height="180dip" android:layout_gravity="center_horizontal" /> </LinearLayout> I use Eclipse and the AVD, and all my learning is done on 2.1 (SDK level 7). I can't test the app on an actual device yet as I don't have it yet. Thanks in advance !

    Read the article

  • Android customizing ViewFlipper...

    - by wearysamurai
    So I'm having pretty much exactly the problem described here: http://code.google.com/p/android/issues/detail?id=6191 and until the ViewFlipper issue in 2.1 and 2.2 has been resolved, I'm attempting to customize my own ViewFlipper in the manner described: @Override protected void onDetachedFromWindow() { try { super.onDetachedFromWindow(); } catch (IllegalArgumentException e) { // Call stopFlipping() in order to kick off updateRunning() stopFlipping(); } } But I've never done this sort of thing before and am hoping to get a little guidance (as my own efforts are coming up short). Here's what I have so far. FixedFlipper.java: import android.content.Context; import android.util.AttributeSet; import android.widget.ViewFlipper; public class FixedFlipper extends ViewFlipper{ public FixedFlipper(Context context){ super(context); } public FixedFlipper(Context context, AttributeSet attrs){ super(context, attrs); } @Override protected void onDetachedFromWindow(){ try{ super.onDetachedFromWindow(); }catch(Exception e){ super.stopFlipping(); } } } main.xml: <com.site.TestApp.FixedFlipper style="@style/body" android:id="@+id/flipper"> ... </com.site.TestApp.FixedFlipper> And in my activity, I invoke it like so: FixedFlipper flipper = (FixedFlipper)findViewById(R.id.flipper); It seems like it should be pretty straightforward, but I keep getting this: Binary XML file line #4: Error inflating class com.site.TestApp.FixedFlipper I appreciate any suggestions. I've been chasing my tail for hours trying to figure out what piece of the puzzle I'm missing.

    Read the article

  • Application as part of Android Built

    - by Gidiyo
    Hi, I had built a application using the Android SDK. Now I would like to package this application as part of the Android build. So that when I port Android into my device, it will appear in the Application menu. I tried, copying the apk file into the package folder, and include it in the make file. Doesn't work. How should I do it?

    Read the article

  • Implement Camera on Android Emulator | Need some knowledge

    - by Thisara
    I'm interested in doing some enhancements to android emulator (implement webcam on emulator). Therefore I'm following the android source and emulators source to get basic understanding & the connection between modules. But its really hard to understand it for someone who is new to android. Therefore can anyone please direct me to some resource to understand this. May be some proper documentation, tutorials or anything that i can understand this. And since i'm interested in emulator if i change the code of emulator with in "external\qemu" , then build it using "m emulator" and run using "emulator" , will those changes effect or apply onto the started emulator. And if anyone know please let me know that, what is the sdk it uses when it run as "emulator" from the build android source code. Cos if i want to install some application to that emulator how can i do that? Please help if anyone know...

    Read the article

  • Bug in the official Android Fragments training sample?

    - by Jeff Axelrod
    It seems to me that there must be a bug in the Android Fragments demo. As background, Fragments are apparently sometimes instantiated by the Android OS and thus need a public no-arg constructor: All subclasses of Fragment must include a public empty constructor. The framework will often re-instantiate a fragment class when needed, in particular during state restore, and needs to be able to find this constructor to instantiate it. If the empty constructor is not available, a runtime exception will occur in some cases during state restore. But the NewsReader demo from the official Android training on Fragments constructs the HeadlinesFragment class and configures it with setOnHeadlineSelectedListener(this) from NewsReaderActivity.onCreate(). If the Android OS re-instantiates this fragment, the mHeadlineSelectedListener field will be null because HeadlinesFragment doesn't save or restore its state. Is this a bug or am I missing something?

    Read the article

  • VerifyError When Running jUnit Test on Android 1.6

    - by DKnowles
    Here's what I'm trying to run on Android 1.6: package com.healthlogger.test; public class AllTests extends TestSuite { public static Test suite() { return new TestSuiteBuilder(AllTests.class).includeAllPackagesUnderHere().build(); } } and: package com.healthlogger.test; public class RecordTest extends AndroidTestCase { /** * Ensures that the constructor will not take a null data tag. */ @Test(expected=AssertionFailedError.class) public void testNullDataTagInConstructor() { Record r = new Record(null, Calendar.getInstance(), "Data"); fail("Failed to catch null data tag."); } } The main project is HealthLogger. These are run from a separate test project (HealthLoggerTest). HealthLogger and jUnit4 are in HealthLoggerTest's build path. jUnit4 is also in HealthLogger's build path. The class "Record" is located in com.healthlogger. Commenting out the "@Test..." and "Record r..." lines allows this test to run. When they are uncommented, I get a VerifyError exception. I am severely blocked by this; why is it happening? EDIT: some info from logcat after the crash: E/AndroidRuntime( 3723): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 3723): java.lang.VerifyError: com.healthlogger.test.RecordTest E/AndroidRuntime( 3723): at java.lang.Class.getDeclaredConstructors(Native Method) E/AndroidRuntime( 3723): at java.lang.Class.getConstructors(Class.java:507) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestGrouping$TestCasePredicate.hasValidConstructor(TestGrouping.java:226) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestGrouping$TestCasePredicate.apply(TestGrouping.java:215) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestGrouping$TestCasePredicate.apply(TestGrouping.java:211) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestGrouping.select(TestGrouping.java:170) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestGrouping.selectTestClasses(TestGrouping.java:160) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestGrouping.testCaseClassesInPackage(TestGrouping.java:154) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestGrouping.addPackagesRecursive(TestGrouping.java:115) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestSuiteBuilder.includePackages(TestSuiteBuilder.java:103) E/AndroidRuntime( 3723): at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:321) E/AndroidRuntime( 3723): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3848) E/AndroidRuntime( 3723): at android.app.ActivityThread.access$2800(ActivityThread.java:116) E/AndroidRuntime( 3723): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) E/AndroidRuntime( 3723): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 3723): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 3723): at android.app.ActivityThread.main(ActivityThread.java:4203) E/AndroidRuntime( 3723): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 3723): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 3723): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) E/AndroidRuntime( 3723): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) E/AndroidRuntime( 3723): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Better way to get int from FragmentActivity in a Fragment?

    - by Gimberg
    Hi im trying to get an int from my FragmentActivity and i have a way to do this but the code get very cluttered and long and i did this to shorten the problem and i don't get any errors while in the editor but when i run the app it eminently crashes. Any suggestions? An example of the code that doesn't work MainActivity mainActivity = ((MainActivity)getActivity()); public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.upgrades_fragment, container, false); TextView AirFreshenersCost = (TextView) view.findViewById(R.id.AirFreshenersCost ); if(mainActivity.amountAirFresheners == 5){ AirFreshenersCost.setText("5"); } return view; } LogCat 10-27 22:16:37.333: E/AndroidRuntime(5593): FATAL EXCEPTION: main 10-27 22:16:37.333: E/AndroidRuntime(5593): java.lang.NullPointerException 10-27 22:16:37.333: E/AndroidRuntime(5593): at com.free.dennisg.clickingbad.fragments.UpgradesFragment.onCreateView(UpgradesFragment.java:40) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1478) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1460) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:472) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.view.ViewPager.populate(ViewPager.java:1068) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.view.ViewPager.populate(ViewPager.java:914) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.support.v4.view.ViewPager$3.run(ViewPager.java:244) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.view.Choreographer.doCallbacks(Choreographer.java:562) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.view.Choreographer.doFrame(Choreographer.java:531) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.os.Handler.handleCallback(Handler.java:730) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.os.Handler.dispatchMessage(Handler.java:92) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.os.Looper.loop(Looper.java:137) 10-27 22:16:37.333: E/AndroidRuntime(5593): at android.app.ActivityThread.main(ActivityThread.java:5289) 10-27 22:16:37.333: E/AndroidRuntime(5593): at java.lang.reflect.Method.invokeNative(Native Method) 10-27 22:16:37.333: E/AndroidRuntime(5593): at java.lang.reflect.Method.invoke(Method.java:525) 10-27 22:16:37.333: E/AndroidRuntime(5593): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 10-27 22:16:37.333: E/AndroidRuntime(5593): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 10-27 22:16:37.333: E/AndroidRuntime(5593): at dalvik.system.NativeStart.main(Native Method) An example of the code that work public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.upgrades_fragment, container, false); TextView AirFreshenersCost = (TextView) view.findViewById(R.id.AirFreshenersCost ); if(((MainActivity)getActivity()).amountAirFresheners == 5){ AirFreshenersCost.setText("5"); } return view; }

    Read the article

  • Panel widget overlapping other contents in android

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

    Read the article

  • Android refresh StateListDrawable problem

    - by Max
    Hi all, I have a strange problem with StateListDrawable or maybe (probably) I'm missing something. I created a test application for it and the same problem occurs. So, this is my StateListDrawable resourse in file test_selection.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="true"> <shape android:shape="rectangle" android:background="#ff0000"> <corners android:radius="10dp" /> <gradient android:startColor="#ff5555" android:endColor="#ff5555" android:angle="0" /> </shape> </item> <item android:state_selected="false"> <shape android:shape="rectangle" android:background="#eeeeee"> <corners android:radius="10dp" /> <gradient android:startColor="#eeeeee" android:endColor="#eeeeee" android:angle="0" /> </shape> </item> </selector> It's a very simple selector that draw a red color for selected state and a white rect for the unselected one. My main.xml template is very simple. I simply use a TextView that uses the selection as background. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" android:textSize="30dp" android:id="@+id/test_view_example" android:background="@drawable/test_selection"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/refresh" android:onClick="updateView" android:text="refresh"></Button> </LinearLayout> My Activity code is also very simple. public class TestDrawableStateActivity extends Activity { private final static int[] SELECTED_STATE = { android.R.attr.state_selected }; private final static int[] UNSELECTED_STATE = {}; private TextView textView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); textView = (TextView) findViewById(R.id.test_view_example); } @Override protected void onResume() { super.onResume(); // Carichiamo la Drawable if(textView.getBackground().setState(SELECTED_STATE)){ textView.invalidate(); } } public void updateView(View view) { if(textView.getBackground().setState(SELECTED_STATE)){ textView.invalidate(); }; } } When Activity starts I try to set the state of my Drawable (the StateListDrawable) with the value SELECTED. It seems all very simple.... but the problem is that the state is not shown. If, later, I click a button and execute the method updateView() the state changes. Where is my problem? Where am I wrong? Thankx a lot Max

    Read the article

  • Changing Color with LinearLayout and TextView in Java (Android)

    - by Rob S.
    I'm a relatively new Android developer and I noticed what seems like an oddity to me that I'm hoping someone can explain. I have LinearLayout ll. This line of code fails for me when executed: ll.setBackgroundColor(R.color.white); However this line of code works: ll.setBackgroundResource(R.color.white); I assume its simply because I have white defined in my resources. However, I've also tried passing 0xFFFFFF in setBackgroundColor() and that doesn't work either. Similarly with my TextView text this line of code fails when executed: text.setTextColor(R.color.white); I can see my TextView so I know I initialized it correctly (like my LinearLayout which I can also see). So I guess my question boils down to: How do I properly use LinearLayout.setBackgroundColor() and TextView.setTextColor() ? Thanks a ton in advance. I've read through the docs and tried to find information online via googling and haven't come up with anything.

    Read the article

  • how to call subactivity of another application android?

    - by Are
    Hi. To call main activity I saw componentName class in android. intent = new Intent(new ComponentName(packageNam,classname); if same is used in case of child activity, I got error , "is activity delcared in andorid manifest?" like error. how to call app1 child activity in app2 by using intent ? In app1 the activity is declared like this in manifest <activity android:name=".activity.MessageCompose" android:label="@string/app_name" android:enabled="false"> - <intent-filter> <action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.SENDTO" /> <data android:scheme="mailto" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> - <intent-filter android:label="@string/app_name"> <action android:name="android.intent.action.SEND" /> <data android:mimeType="*/*" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> - <intent-filter android:label="@string/app_name"> <action android:name="android.intent.action.SEND_MULTIPLE" /> <data android:mimeType="*/*" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>

    Read the article

  • Android application displays black screen after running

    - by frgnvola
    When I click "Run as an Android Application" on Eclipse, the following is displayed in the console [2014-06-05 20:07:18 - StudentConnect] Android Launch! [2014-06-05 20:07:18 - StudentConnect] adb is running normally. [2014-06-05 20:07:18 - StudentConnect] Performing sandhu.student.connect.SplashActivity activity launch [2014-06-05 20:07:18 - StudentConnect] Using default Build Tools revision 19.0.0 [2014-06-05 20:07:18 - StudentConnect] Refreshing resource folders. [2014-06-05 20:07:18 - StudentConnect] Using default Build Tools revision 19.0.0 [2014-06-05 20:07:18 - StudentConnect] Starting incremental Pre Compiler: Checking resource changes. [2014-06-05 20:07:18 - StudentConnect] Nothing to pre compile! [2014-06-05 20:07:18 - StudentConnect] Starting incremental Package build: Checking resource changes. [2014-06-05 20:07:18 - StudentConnect] Using default Build Tools revision 19.0.0 [2014-06-05 20:07:18 - StudentConnect] Skipping over Post Compiler. [2014-06-05 20:07:20 - StudentConnect] Application already deployed. No need to reinstall. [2014-06-05 20:07:20 - StudentConnect] Starting activity sandhu.student.connect.SplashActivity on device 0f0898b2 [2014-06-05 20:07:21 - StudentConnect] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=sandhu.student.connect/.SplashActivity } [2014-06-05 20:07:21 - StudentConnect] ActivityManager: Warning: Activity not started, its current task has been brought to the front After deployed to my phone, it only displays a black screen. I recently implemented a splash screen, but it was working fine before; however I think it might have something to do with the problem. Here are my java and xml files: MainActivity.java package sandhu.student.connect; import android.app.Activity; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends Activity { public WebView student_zangle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView student_zangle = (WebView) findViewById(R.id.student_zangle); student_zangle.loadUrl("https://zangleweb01.clovisusd.k12.ca.us/studentconnect/"); student_zangle.setWebViewClient(new WebViewClient()); student_zangle.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); WebSettings settings = student_zangle.getSettings(); settings.setJavaScriptEnabled(true); settings.setBuiltInZoomControls(true); settings.setLoadWithOverviewMode(true); settings.setUseWideViewPort(true); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { WebView student_zangle = (WebView) findViewById(R.id.student_zangle); if ((keyCode == KeyEvent.KEYCODE_BACK) && student_zangle.canGoBack()) { student_zangle.goBack(); return true; } else { finish(); } return super.onKeyDown(keyCode, event); } } activity_main.xml <?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:background="@drawable/blue" tools:context=".MainActivity" > <WebView android:id="@+id/student_zangle" android:layout_width="match_parent" android:layout_height="match_parent" /> </RelativeLayout> SplashActivity.java package sandhu.student.connect; import android.os.Bundle; import android.preference.PreferenceActivity; public class SplashActivity extends PreferenceActivity { @SuppressWarnings("deprecation") @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.prefs); } } splash_activity.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/blue" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="250dp" android:layout_height="100dp" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="145dp" android:contentDescription="@string/zangle_logo" android:src="@drawable/logo" /> </RelativeLayout> Also, here is a full copy of the logcat error output: 06-05 20:19:46.698: E/Watchdog(817): !@Sync 1952 06-05 20:20:09.971: E/memtrack(16438): Couldn't load memtrack module (No such file or directory) 06-05 20:20:09.971: E/android.os.Debug(16438): failed to load memtrack module: -2 06-05 20:20:11.012: E/memtrack(16451): Couldn't load memtrack module (No such file or directory) 06-05 20:20:11.012: E/android.os.Debug(16451): failed to load memtrack module: -2 06-05 20:20:11.202: E/EnterpriseContainerManager(817): ContainerPolicy Service is not yet ready!!! Please help me figure out what is wrong, or at least point me in the right direction. Thanks in advance.

    Read the article

  • Ubuntu.sh on Android Phone

    - by pjtatlow
    So today I noticed something weird on my phone. I used a terminal emulator to see what I could do with it, and noticed that there is a file called ubuntu.sh. I tried to run it and got all sorts of permission denied errors, and then I decided to root my phone. But now I'm nervous to run it, does anyone know what it does or why it is there? edit I forgot to mention that I have an AT&T Morotola Atrix 4G running Android 2.3.6. Also when I use the app SSHDroid to go into my phone from my Ubuntu machine, I'm greeted with this: "The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. To access official Ubuntu documentation, please visit: http://help.ubuntu.com/" Also, here are the contents of ubuntu.sh #!/bin/sh export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib # make sure no left-over pidfiles, etc. ####################################### rm -fr /var/run/* rm -fr /var/lock/* chmod 666 /system/usr/keychars/* rm -f /tmp/tab* mkdir -p /home/adas/Desktop chmod 755 /home/adas/Desktop chown -R adas.adas /home/adas/Desktop [ -x /usr/bin/firefox-install-profile ] && /usr/bin/firefox-install-profile [ -x /usr/local/bin/check-citrix-certs.sh ] && /usr/local/bin/check-citrix-certs.sh [ -x /usr/bin/migrate-webapps ] && /usr/bin/migrate-webapps # boot scripts ############## /etc/init.d/rc S # lock down /var for CTS ######################## chown root.adas /var/tmp chown root.adas /var/lock chmod 775 /var/tmp chmod 775 /var/lock chmod 666 /dev/socket/dbus chmod 666 /dev/null # runlevel 2 scripts #################### /etc/init.d/rc 2 cp /sdcard/*.lic /data/ chmod 666 /data/*.lic This is really strange, any ideas?

    Read the article

  • Problems using custom keyboard layout / symbols file

    - by January
    I have a custom xkb symbols file which looks as follows: // modify the basic German layout to have polish characters default partial alphanumeric_keys xkb_symbols "basic" { include "de(basic)" name[Group1]="Germany - with polish characters"; key <AD03> { [ e, E, eogonek, Eogonek ] }; key <AD09> { [ o, O, oacute, Oacute ] }; key <AC01> { [ a, A, aogonek, Aogonek ] }; key <AC02> { [ s, S, sacute, Sacute ] }; key <AD06> { [ z, Z, zabovedot, Zabovedot ] }; key <AB02> { [ x, X, zacute, Zacute ] }; key <AB03> { [ c, C, cacute, Cacute ] }; key <AB06> { [ n, N, nacute, Nacute ] }; }; The name of the file is depl. I copy the file to /usr/share/X11/xkb/symbols and it works with setxkbmap depl. However, I also tried to add the respective menu entries in the "Text Entry" customization. I have modified the file /usr/share/X11/xkb/rules/evdev.xml and added the following section: <layout> <configItem> <name>depl</name> <shortDescription>depl</shortDescription> <description>German (with Polish characters)</description> <languageList> <iso639Id>ger</iso639Id> </languageList> </configItem> </layout> I have then reconfigured the xkb data with sudo dpkg-reconfigure xkb-data. It works in as much as that the new layout appears as a viable option in the Text Entry dialog, it can be added to the list of dialogs and is visible in the application indicator: However, it does not work, the new symbols are not loaded. No errors are reported in /var/log/Xorg.0.log.

    Read the article

  • Android layout alignment issues

    - by Jake Schwartz
    So I am trying to get my layout to look like this: | button text button | So that the text is centered between my two buttons. I first tried using LinearLayouts and layout_gravity tags, but that would give me something like: | buttontextbutton | and now I have a relative layout with alignParentLeft/Right and centerInParent tags but the layout now looks like | button text buttonnnnnnnnnnnnn | Is there a way to get my layout right with text that changes lengths? Thanks, Jake

    Read the article

  • android layout-land and screen-rotation handling

    - by davs
    I have layouts for portrait mode (in folder layout) and for landscape one (in the folder layout-land). This screen is located under one of the tabs, so I had to handle screen rotating (after screen has been rotated, no default screen restart occurs). I would like to update view from 'layout-land' when screen rotates to landscape mode and from 'layout' when screen rotates to portrait one. How can I do this?

    Read the article

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