Search Results

Search found 727 results on 30 pages for 'apk'.

Page 7/30 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • 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 local search

    - by Aleksander O
    Hi! I'm trying to implement a local search in my activity. I've added an appropriate intent filter and metadata tag to manifest file but if I click Search button it invokes standard android search box. What's my problem? Manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.nixsolutions.invertigation.android.dataprovider" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true"> <provider android:name="NoteProvider" android:authorities="com.nixsolutions.investigation.android.NoteProvider"> </provider> <activity android:name="NotesList"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> </activity> </application> <uses-sdk android:minSdkVersion="7" /> </manifest> searchable.xml: <?xml version="1.0" encoding="utf-8"?> <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:label="Custom search" android:hint="Custom hint" android:searchMode="showSearchLabelAsBadge" />

    Read the article

  • Nested Linear layout only shows first view after being set from gone to visible in Android

    - by Adam
    Hi guys, I am developing an Android app but I'm still pretty new. I want to have a button, and when you push that button, a few TextViews and Buttons will appear. So I have a main linear layout, and then another linear layout nested inside containing the things I want hidden. I have the nested linear layout set to android:visibility="gone". The problem I am having is that it only shows the first item inside the hidden linear layout instead of all of them. The way I try to make it appear is vgAddView = (ViewGroup)findViewById(R.id.add_details); btnAche.setOnClickListener(new OnClickListener(){ public void onClick(View v){ vgAddView.setVisibility(0); } }); My XML file is this <?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" > <Button android:text="@string/but_stomach_ache" android:id="@+id/but_stomach_ache" android:layout_width="fill_parent" android:layout_height="wrap_content"> </Button> <Button android:text="@string/but_food" android:id="@+id/but_food" android:layout_width="fill_parent" android:layout_height="wrap_content"> </Button> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/add_details" android:visibility="gone"> <TextView android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/when_happen"> </TextView> <Button android:text="@string/happen_now" android:id="@+id/happen_now" android:layout_width="fill_parent" android:layout_height="wrap_content"> </Button> </LinearLayout> </LinearLayout>

    Read the article

  • Android fragments problems different layouts

    - by juan
    I have two layouts: one for portait with one container and another for landscape with two containers. In the first layout I show a fragment and when the user select one element, I replace the fragment with another (with FragmentTransation.Replace). <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" > <LinearLayout android:id="@+id/container1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" /> </RelativeLayout> In the second layout I want to show the two fragments at one time, one in the first container and the second in the second container. <LinearLayout 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" > <LinearLayout android:id="@+id/container1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="3" android:orientation="vertical" /> <LinearLayout android:id="@+id/container2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="7" android:orientation="vertical" /> </LinearLayout> But I can't make this works with configuration changes. I try use different names for containers, try add fragments when only bundle is null,... Someone have a working code of this case?

    Read the article

  • Android how to use checkedtextview

    - by erdomester
    the title speaks for itself. I am over several articles, topics and still haven't figured out how to use checkedtextview. I want a listview with checkable items. In the following code i am using a listview and populating it with a string array. But how to change it to checkedtextview? delete.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:paddingTop="4dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/linlay0" android:background="@color/list_bg"> <TextView android:id="@+id/TextView00" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#D8D8D8" android:textColor="#424242" android:gravity="center_horizontal|center_vertical" android:textSize="20px" android:height="40px" android:textStyle="bold" /> <ListView android:id="@+id/ListView01" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> delete_lv.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/list_content" android:textColor="#222222" android:gravity="center" android:text="sample" android:layout_margin="4dip" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> Delete.java: public class Delete extends Activity { ListView lv1; ArrayAdapter<String> adapter1; private String lv_items[] = { "Android", "iPhone", "BlackBerry", "AndroidPeople", "J2ME", "Listview", "ArrayAdapter", "ListItem", "Us", "UK", "India" }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.delete); TextView tv0 = (TextView)findViewById(R.id.TextView00); tv0.setText("Deletes"); lv1 = (ListView) findViewById(R.id.ListView01); adapter1 = new ArrayAdapter<String>(Delete.this,R.layout.list_black_text,R.id.list_content, lv_items); lv1.setAdapter(adapter1); adapter1.notifyDataSetChanged(); } }

    Read the article

  • Getting message in android app: Binary XML file line #2: You must supply a layout_width attribute.

    - by opike
    I'm trying to use a ListView inside of a RelativeLayout but when I run my app I get a runtimeexception with the message: Binary XML file line #2: You must supply a layout_width attribute. I tried putting layout_width attributes in every conceivable place in the xml resource files but so far no luck. I attempt to populate the listview with this line of code: setListAdapter(new ArrayAdapter(this, R.layout.tablerow3, R.id.label, items)); Here's the tablerow3.xml contents: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"> android:layout_width="20dp" android:layout_height="5dp" android:id="@+id/tablerow01"> <Label android:id="@+id/label01" android:layout_width="5dp" android:layout_height="5dp" android:textColor="@color/solid_white" android:singleLine="true"/> <Label android:id="@+id/label02" android:layout_width="5dp" android:layout_height="5dp" android:textColor="@color/solid_white" android:singleLine="true"/> </LinearLayout> Here's the xml that contains the RelativeLayout(forex2.xml): <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:text="Static Button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:id="@+id/button_id"> </Button> <Spinner android:id="@+id/spinner1" android:layout_width="match_parent" android:layout_toRightOf="@id/button_id" android:layout_alignParentTop="true" android:layout_height="wrap_content" android:drawSelectorOnTop="true" /> <ListView android:id="@android:id/list" android:layout_width="5dp" android:layout_height="5dp" android:layout_alignParentBottom="true" /> <!-- android:layout_width="wrap_content" android:layout_height="wrap_content" --> </RelativeLayout>

    Read the article

  • RadioGroup does not appear ?

    - by Mina Samy
    Hi all I have a linear layout with this form <?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" > <RadioGroup android:id="@+id/group" android:layout_width="wrap_content" android:layout_height="wrap_content"> <RadioButton android:id="@+id/item1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Item1" android:checked="true" /> <RadioButton android:id="@+id/item2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Item2" /> <RadioButton android:id="@+id/item3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Item3" /> </RadioGroup> <TextView android:id="@+id/txt" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> this works fine but if I put the TextView above the RadioGroup like this <?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:id="@+id/txt" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <RadioGroup android:id="@+id/group" android:layout_width="wrap_content" android:layout_height="wrap_content" > <RadioButton android:id="@+id/item1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Item1" android:checked="true" /> <RadioButton android:id="@+id/item2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Item2" /> <RadioButton android:id="@+id/item3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Item3" /> </RadioGroup> </LinearLayout> the activity appears blank what can be the reason for this thanks

    Read the article

  • Imageview in a listview - Height is bugged?

    - by Abdullah Gheith
    I am having a listview but i have problem i have the main.xml file, which contains a Listview: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/gradient" android:gravity="center" android:padding="1pt"> <ListView android:id="@+id/ListView01" android:layout_width="wrap_content" android:layout_height="fill_parent" android:background="@android:color/transparent" android:cacheColorHint="#00000000"/> </LinearLayout> Then, i have a custom listview file called listview.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:background="@android:color/transparent" android:cacheColorHint="#00000000"> <TextView android:gravity="center" android:textColor="#ffffff" android:background="#0097D0" android:text="Overskrift" android:id="@+id/tvOverskrift" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textStyle="bold" /> <ImageView android:id="@+id/ivBillede" android:scaleType="fitXY" android:padding="2px" android:gravity="fill" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/test"/> <TextView android:gravity="center" android:textColor="#ED2025" android:text="Dato" android:id="@+id/tvDato" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="normal"/> <TextView android:gravity="left" android:textColor="#000000" android:text="Indledning" android:id="@+id/tvIndledning" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="normal"/> </LinearLayout> the bitmap in the imagview i am getting is from a URL. By that code, i am getting is this: http://img585.imageshack.us/img585/5665/unavngivetv.png I am getting too much space in the height as you see

    Read the article

  • Custom title of PreferenceActivity (problem)

    - by Emerald214
    I have the same problem like this question: Custom title bar in PreferenceActivity ?? After extending PreferenceActivity, I write this code in onCreate(), it just shows a blank grey title. I think it is a bug (because this solution works well with Activity). requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title); super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.main_pref); Edited: window_title.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:background="@color/titleBar" android:layout_height="wrap_content" android:gravity="center_vertical" android:paddingLeft="5dip" android:paddingRight="5dip"> <ImageView android:id="@+id/imageView1" android:src="@drawable/megadict_icon" android:layout_height="35dip" android:layout_width="35dip" android:layout_gravity="center_vertical"> </ImageView> <TextView android:layout_width="wrap_content" android:id="@+id/textView1" android:layout_height="wrap_content" android:textColor="@color/white" android:textSize="16dip" android:layout_weight="1" android:layout_gravity="center_vertical" android:text="@string/appName" android:paddingLeft="5dip" android:paddingRight="5dip"> </TextView> <ProgressBar style="?android:attr/progressBarStyleSmall" android:id="@+id/progressBar" android:layout_width="28dip" android:layout_height="28dip" android:layout_gravity="center_vertical" android:visibility="invisible"> </ProgressBar> </LinearLayout> main_pref.xml <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/mainPrefTitle"> <ListPreference android:entries="@array/languageStrings" android:entryValues="@array/languageValues" android:dialogTitle="@string/languagePrefTitle" android:title="@string/mainPrefTitle" android:key="languagePrefKey"> </ListPreference> </PreferenceScreen>

    Read the article

  • Make buttonsize bigger for tablet? Android, Xml

    - by Cornelia G
    I have a android view with 2 buttons centered. I want to change the button sizes to be bigger when I run the app on a tablet because they look ridiculous small there since it is the same size as for the phones. How can I do this? This is my code: <?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="#e9e9e9" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" > <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerInParent="true" android_layout_gravity= "center" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:src="@drawable/icon_bakgrund_android"> </ImageView> <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/TableLayout01" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerInParent="true" > <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button1" android:layout_width="260dp" android:layout_height="50dp" android:background="@drawable/nybutton" android:layout_below="@+id/button2" android:text="@string/las_sollefteabladet" android:textColor="#ffffff" android:layout_centerHorizontal="true"/> </TableRow> <TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerCrop"> <Button android:id="@+id/button2" android:layout_width="260dp" android:layout_height="50dp" android:layout_marginTop="10dp" android:background="@drawable/nybutton" android:layout_centerInParent="true" android:text="@string/annonsorer" android:textColor="#ffffff" /> </TableRow> </TableLayout> </RelativeLayout> </RelativeLayout>

    Read the article

  • Android - updating a list adapter creates a NullPointException

    - by GeekedOut
    I have a ListActivity which has an adapter that crashes. Here is the code that crashes the program: Question q = new Question (); q.setQuestion( "" ); questions.add(q); adapter = new ArrayAdapter<Question>(this, R.layout.user_question_list, R.id.label, questions); Here is how I create the adapter: ArrayAdapter<Question> adapter; ArrayList<Question> questions = new ArrayList <Question>( ); and the list xml is like this: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:textSize="16sp" > </TextView> and the overall Activity xml is like this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/question_label" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Loading your questions..." /> <ListView android:id="@android:id/list" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@+id/label" android:textSize="20px" > </ListView> <Button android:id="@+id/add_question" android:layout_height="wrap_content" android:text="Ask a Question" android:onClick="sendFeedback" android:layout_width="fill_parent"> </Button> </LinearLayout> Any idea why the code where I try to update the adapter results in the NullPointerException? Thanks!!

    Read the article

  • eclipse adt 17 and the libs folder

    - by max4ever
    Ok so i update to eclipse adt to version 17 and I get this error 04-05 12:28:55.810: E/AndroidRuntime(5470): FATAL EXCEPTION: main 04-05 12:28:55.810: E/AndroidRuntime(5470): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.galeola.agentis/com.galeola.agentis.activity.GestionaleActivity}: java.lang.ClassNotFoundException: com.galeola.agentis.activity.GestionaleActivity in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.galeola.agentis-1.apk] 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1742) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1834) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.access$500(ActivityThread.java:122) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1027) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.os.Handler.dispatchMessage(Handler.java:99) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.os.Looper.loop(Looper.java:132) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.main(ActivityThread.java:4126) 04-05 12:28:55.810: E/AndroidRuntime(5470): at java.lang.reflect.Method.invokeNative(Native Method) 04-05 12:28:55.810: E/AndroidRuntime(5470): at java.lang.reflect.Method.invoke(Method.java:491) 04-05 12:28:55.810: E/AndroidRuntime(5470): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) 04-05 12:28:55.810: E/AndroidRuntime(5470): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) 04-05 12:28:55.810: E/AndroidRuntime(5470): at dalvik.system.NativeStart.main(Native Method) 04-05 12:28:55.810: E/AndroidRuntime(5470): Caused by: java.lang.ClassNotFoundException: com.galeola.agentis.activity.GestionaleActivity in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.galeola.agentis-1.apk] 04-05 12:28:55.810: E/AndroidRuntime(5470): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251) 04-05 12:28:55.810: E/AndroidRuntime(5470): at java.lang.ClassLoader.loadClass(ClassLoader.java:540) 04-05 12:28:55.810: E/AndroidRuntime(5470): at java.lang.ClassLoader.loadClass(ClassLoader.java:500) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.Instrumentation.newActivity(Instrumentation.java:1022) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1733) 04-05 12:28:55.810: E/AndroidRuntime(5470): ... 11 more however if i move my libraries to /libs i can start the applications, but with the libraries in /libs javadoc and javasources stops working, while if they are not in /libs javadoc and javasource works, so I don't understand why.

    Read the article

  • how to compare the two xml files and update the one xml file in java?

    - by prasad.gai
    I have created two xml files from those xml file i would like to compare one xml file with another xml file and update the xml file. I have created an xml file as follows: main.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#00BFFF"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:visibility="visible"> </LinearLayout> <LinearLayout android:id="@+id/linearLayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:visibility="visible"> </LinearLayout> </LinearLayout> </ScrollView> properties.xml <?xml version='1.0' encoding='utf-8' standalone='yes' ?> <map> <int name="linearLayout1" value="8" /> <int name="linearLayout2" value="0" /> </map> from the above two xml files i would like to compare with LinearLayout android:id ="@id/LinearLayout1" from main.xml with int name ="linearLayout1" from properties.xml. from the above properties.xml file where name ="linearLayout1" and value ="8" then i would like to update the main.xml file where as LinearLayout android:id="@id/linearLayout1" propertie value as android:visibility="gone" From the above xml file how can i update main.xml file by comparing properties.xml? please any body help me.....

    Read the article

  • GridView: How can I get rid of extra space from my GirdView object?

    - by Lajos Arpad
    Hello, I'm writing an application for Android phones for Human vs. Human chess play over the internet. I was looking at some tutorials, to learn how to develop Android applications and found a very nice example of making galleries (it was a GridView usage example for making a gallery about dogs) and the idea came to draw the chess table using a GridView, because the example project also handled the point & click event and I intended to use the same event in the same way, but for a different purpose. The game works well (currently it's a hotseat version), however, I'm really frustrated by the fact that whenever I rotate the screen of the phone, my GridView gets hysterical and puts some empty space in my chess table between the columns. I realized that the cause of this is that the GridView's width is the same as its parent's and the GridView tries to fill its parent in with, but there should (and probably is) be a simple solution to get rid of this problem. However, after a full day of researching, I haven't found any clue to help me to make a perfect drawing about my chess table without a negative side effect in functionality. The chess table looks fine if the phone is in Portrait mode, but in Landscape mode it's far from nice. This is how I can decide whether we are in Portrait or Landscape mode: ((((MainActivity)mContext).getWindow().getWindowManager().getDefaultDisplay().getWidth()) < ((MainActivity)mContext).getWindow().getWindowManager().getDefaultDisplay().getHeight()) In the main.xml file the GridView is defined in the following way: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:numColumns="8" android:verticalSpacing="0dp" android:horizontalSpacing="0dp" android:stretchMode="columnWidth" android:gravity="center" > </GridView> ... </LinearLayout> I appreciate any help with the problem and thank you for reading this.

    Read the article

  • Updated - Having trouble making a circled button in android

    - by user3641545
    I'm trying to use an image as a button. The image is an oval/circle, so when I set it as the background there's basically a black box with the image on top of it. How can I fix this? This is the fragment main xml: <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:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.example1.MainActivity$PlaceholderFragment" > <ImageButton android:id="@+id/hardButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:background="@drawable/hard_button_clickable" android:onClick="hardButton" android:text="@string/button_hard" android:textColor="#ffff00" android:textSize="50sp" /> </RelativeLayout> This is the hard button xml: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/hard_button_img" android:state_focused="true" android:state_pressed="false"/> <item android:drawable="@drawable/hard_button_img" android:state_focused="true" android:state_pressed="true"/> <item android:drawable="@drawable/hard_button_img"/> </selector> Here's the problem in the app: http://i.gyazo.com/a7f3b25341ebf4146d294df1f5660e99.png I've tried setting background to null and setting src to my image file. Nothing changed. Thanks. e; Here's the actual PNG: http://tinypic.com/r/av3cli/8 e; Still looking for help with this!

    Read the article

  • Does Android XML Layout's 'include' Tag Really Work?

    - by Eric Burke
    I am unable to override attributes when using <include> in my Android layout files. When I searched for bugs, I found Declined Issue 2863: "include tag is broken (overriding layout params never works)" Since Romain indicates this works in the test suites and his examples, I must be doing something wrong. My project is organized like this: res/layout buttons.xml res/layout-land receipt.xml res/layout-port receipt.xml The buttons.xml contains something like this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <Button .../> <Button .../> </LinearLayout> And the portrait and landscape receipt.xml files look something like: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> ... <!-- Overridden attributes never work. Nor do attributes like the red background, which is specified here. --> <include android:id="@+id/buttons_override" android:background="#ff0000" android:layout_width="fill_parent" layout="@layout/buttons"/> </LinearLayout> What am I missing?

    Read the article

  • xml vs java LinearLayout fills

    - by user293443
    the xml version below properly handles height and width and the java doesn't what is the java missing? xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="horizontal"> <include android:id="@+id/cell1" layout="@layout/grid_text_view" /> <include android:id="@+id/cell2" layout="@layout/grid_text_view" /> </LinearLayout> java LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.HORIZONTAL); ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); ll.addView((TextView)this.getLayoutInflater().inflate(R.layout.grid_text_view, null)); ll.addView((TextView)this.getLayoutInflater().inflate(R.layout.grid_text_view, null)); setContentView(ll); grid_text_view <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="0dip" android:text="1" android:textSize="20sp" android:gravity="center" android:layout_weight="1" /> I've tried a ll.invalidate() and it didn't work either? :( screenshots at http://www.flickr.com/photos/48409507@N06/sets/72157623618407586/

    Read the article

  • Error in pom file in Maven project,after importing into eclipse

    - by dipti
    I am actually new to the Maven framework.I already have a Maven project.I installed the Maven plugin etc into my EclipseIDE from http://m2eclipse.sonatype.org/sites/m2e.Then I imported my project and enabled dependencies.But the project is showing too many errors.The pom.xml itself is showing errors.The errors are"Project Build Error:unknown packaging:apk",Project Build Error:unresolvable build extension:plugin" etc. My error area is: project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 4.0.0 <groupId>com.nbc.cnbc.android</groupId> <artifactId>android.domain.tests</artifactId> <version>1.0.0</version> <packaging>apk</packaging> <parent> <groupId>com.nbc.cnbc.android</groupId> <artifactId>android.domain.parent</artifactId> <version>1.0.0</version> <relativePath>../android.domain.parent/pom.xml</relativePath> </parent> <name>android.domain.tests</name> <url>http://maven.apache.org</url> Could it be because the url specified in the last line could be different??? Any ideas why this could be happening?? Any reply is highly appreciated.Thanks a looot in advance!! Regards, Dipti

    Read the article

  • Android - Widget to Play Video (onclick trouble)

    - by Josh
    I am trying to make a simple widget that will play a movie from the sdcard when clicked on. This seems simple enough, and by following tutorials I've come up with the following code, but it seems the onclick is never setup. Manifest: <receiver android:name="WidgetProvider" android:label="DVD Cover"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info_2x4"/> </receiver> Layout (widget.xml): <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/holder" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ff777777" > <ImageView android:id="@+id/cover" android:layout_width="wrap_content" android:layout_height="fill_parent" android:textColor="#000000" /> </LinearLayout> appwidget.xml: <?xml version="1.0" encoding="utf-8"?> <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="200dip" android:minHeight="300dip" android:updatePeriodMillis="180000" android:initialLayout="@layout/widget" > </appwidget-provider> WidgetProvider.java: public class WidgetProvider extends AppWidgetProvider { public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { String movieurl = Environment.getExternalStorageDirectory().getPath() + "/Movie.mp4"; Intent notificationIntent = new Intent(Intent.ACTION_VIEW); notificationIntent.setDataAndType(Uri.parse(movieurl), "video/*"); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent,0); // Get the layout for the App Widget and attach an on-click listener // to the button RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget); views.setOnClickPendingIntent(R.id.holder, contentIntent); // Tell the AppWidgetManager to perform an update on the current app widget appWidgetManager.updateAppWidget(appWidgetIds, views); } } Any help would be greatly appreciated. Thanks, Josh

    Read the article

  • Android: Why my user Interface does not get drawn when I Inflate the resource layout file?

    - by Einiosaurus
    First of all, I'm a newbie on Android programming, so please be detailed in your answers. I have a layout main.xml file with format similar to <?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"> <LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:orientation = "horizontal"   android:layout_width = "fill_parent" android:layout_height = "fill_parent"> <EditText android:id="@+id/a" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <TextView android:id="@+id/xSquared" android:layout_width = "fill_parent" android:layout_height = "wrap_content" android:text = "@string/equationPart1" /> </LinearLayout> <LinearLayout ... </LinearLayout> </LinearLayout> In my Java source file, I inflate the UI using command: setContentView(R.layout.main); public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } However, when I run the emulator, the UI does not show up like what I expect. Instead, it just display a simple EditText text box. I wonder what is going wrong. Is it because I put a layout inside another layout? I don't think there is any problem with that right?

    Read the article

  • Android Maps: Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY

    - by AP257
    I'm trying to use Android Maps, following the instructions in Hello MapView. I've added <uses-library android:name="com.google.android.maps" /> in the Manifest, and I'm building against the 'Google APIs' target, which claims to be API version 7. So I don't think I'm doing anything obviously wrong, but the project refuses to build with this error: [2010-12-22 13:34:32 - FMS]Installing FMS.apk... [2010-12-22 13:35:01 - FMS]Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY [2010-12-22 13:35:01 - FMS]Please check logcat output for more details. [2010-12-22 13:35:01 - FMS]Launch canceled! logcat is telling me the following (not very enlightening): D/PackageParser( 55): Scanning package: /data/app/vmdl67147.tmp I/PackageParser( 55): com.android.fms: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE E/PackageManager( 55): Package com.android.fms requires unavailable shared library com.google.android.maps; failing! W/PackageManager( 55): Package couldn't be installed in /data/app/com.android.fms.apk D/AndroidRuntime( 206): Shutting down VM It is possible I haven't set up the Maps API key correctly - when I got it using keytools, I didn't specify an alias_name, though this didn't seem to cause an error. Can anyone help?

    Read the article

  • What is the corrrect way to increment a field making up part of a composit key

    - by Tr1stan
    I have a bunch of tables whose primary key is made up of the foreign keys of other tables (Composite key). Therefore for example the attributes (as a very cut down version) might look like this: A[aPK, SomeFields] 1:M B[bPK, aFK, SomeFields] 1:M C[cPK, bFK, aFK, SomeFields] as data this could look like: A[aPK, SomeFields]: 1, Foo 2, Bar B[bPK, aFK, SomeFields]: 1, 1, FooData1 2, 1, FooData2 1, 2, BarData1 2, 2, BarData2 C[cPK, bFK, aFK, SomeFields]: 1, 1, 1, FooData1More 2, 1, 1, FooData1More 1, 2, 1, FooData2More 2, 2, 1, FooData2More 1, 1, 2, BarData1More 2, 1, 2, BarData1More 1, 2, 2, BarData2More 2, 2, 2, BarData2More I've got this running in a MSSQL DBMS and I'm looking for the best way to increment the left most column, in each table when a new tuple is added to it. I can't use the Auto Increment Identity Specification option as that has no idea that it is part of a composite key. I also don't want to use any aggregate function such as: MAX(field)+1 as this will have adverse affects with multiple users inputting data, rolling back etc. There might however be a nice trigger based option here, but I'm not sure. This must be a common issue so I'm hoping that someone has a lovely solution. As a side which may or may not affect the answer, I'm using Entity Framework 1.0 as my ORM, within a c# MVC application.

    Read the article

  • How to Use border as an image in android xml

    - by Ethan Hunt
    I have a popup to show in my xml. It should have a border. Following is the code:- <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rl_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="20dp" > <RelativeLayout android:id="@+id/rl_startpopup" android:layout_width="340dp" android:layout_height="320dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:background="@drawable/popup_outline" android:orientation="vertical" /> </RelativeLayout> The popup_outline is a shape <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:angle="270" android:endColor="#192423" android:startColor="#4a7669" android:type="linear" /> <corners android:radius="8dp" /> <stroke android:width="2dp" android:color="#e4f4d3" /> </shape> here is the image of the popup:- This "popup_outline" is the white border shown. I want to use a repeatable pattern image instead of one color as the border. I have to do this in xml. Please help

    Read the article

  • Updating an application OTA

    - by Bostjan
    I'm developing an application that will be available from a website (market probably as well). The problem I'm having at the moment is how to handle the updates to the app. I know how to check the version against the current one and I know if I need to update it. Question is...how? Is there a way I can download an APK from the website and start the install process? The user will have to confirm of course, but I just want to be able to start it for him. At the moment I'm doing this: private void doUpgrade() { // TODO Auto-generated method stub Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.upgrade)); builder.setIcon(R.drawable.help); builder.setMessage(getString(R.string.needUpgrade)); builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Map<String, String> data = new HashMap<String, String>(); try { HttpResponse re = Registration.doPost("http://www.android-town.com/appRelease/AndroidTown.apk",data); int statusCode = re.getStatusLine().getStatusCode(); closeApp(); } catch (ClientProtocolException e) { e.printStackTrace(); Toast.makeText(getApplicationContext(), getString(R.string.noURLAccess), Toast.LENGTH_SHORT).show(); closeApp(); } catch (IOException e) { e.printStackTrace(); Toast.makeText(getApplicationContext(), getString(R.string.noURLAccess), Toast.LENGTH_SHORT).show(); closeApp(); } } }); builder.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub dialog.cancel(); closeApp(); } }); builder.show(); } But it doesn't really do anything...should I open a webView with the URL? A new runnable thread? Any other way? Please help :) Cheers

    Read the article

  • Android shared library which is not JNI based

    - by Mondain
    I am developing a library for Android applications which does not use native code (JNI). I have tried suppling the library as an external jar in my Android projects but this method does not include the library contents in the apk and thus throws class not found errors when run in the emulator or device. I have also tried creating the library as an Android project in itself and this does work, but only for public static properties (not methods). With the library and application both being in separate apk's I can see that the VM notices references to the library and can read some properties, but when an attempt to instantiate a class in the library is executed I get class not found even though I can read the public static properties from it (very frustrating!!). I realize that Davlik byte code is not the same as Java byte code but I am having trouble even finding good information about how to solve what would seem to be a very simple issue in Android. I am looking into the old PlatformLibrary stuff right now but I am not convinced this will work either since the sample has been removed from the Android site :( So help me out if you can, if I find the answer before this happens I will share it. viva la Android!

    Read the article

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