Search Results

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

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

  • Android ListView delete row button - focus issue

    - by Max Gontar
    Hi! I have an activity with ListView and buttons below: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <ListView android:id="@+id/lvLamps" android:layout_width="fill_parent" android:layout_height="fill_parent" android:listSelector="@null" android:choiceMode="none" android:scrollbarStyle="insideInset" android:layout_weight="1.0" /> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="0.0"> <Button android:id="@+id/btnAdd" android:background="@null" android:drawableLeft="@drawable/btn_upgrade" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableRight="@drawable/lbl_upgrade" android:textSize="0pt" android:text="" android:layout_alignParentLeft="true" android:padding="20px" /> <Button android:id="@+id/btnNext" android:background="@null" android:drawableRight="@drawable/next_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableLeft="@drawable/lbl_next" android:textSize="0pt" android:text="" android:layout_alignParentRight="true" android:padding="20px" android:visibility="gone" /> <ImageButton android:id="@+id/btnListExit" android:background="@null" android:src="@drawable/btn_x" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:padding="20px" /> </RelativeLayout> </LinearLayout> ListView row contains delete button: <?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="horizontal" android:focusable="true"> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:focusable="true"> <ImageButton android:id="@+id/btnRowDelete" android:src="@drawable/btn_x" android:background="@null" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:padding="4px" android:focusable="true" android:focusableInTouchMode="true"/> <TextView android:id="@+id/txtLampRowFrom" android:text="123" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="6pt" android:layout_toRightOf="@id/btnRowDelete" android:focusable="false" android:textColor="@color/textColor"/> <TextView android:id="@+id/txtLampRowTo" android:text="123" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="6pt" android:layout_toRightOf="@id/btnRowDelete" android:layout_alignParentBottom="true" android:focusable="false" android:textColor="@color/textColor"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/arrow_upgrade_to" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:focusable="false"/> </RelativeLayout> </LinearLayout> In Adapter, Button onClickListener is set, also there are dummies to make list non-selectable: // disabling list items select public boolean areAllItemsEnabled() { return false; } public boolean isEnabled(int position) { return false; } What I want is: always show buttons in the bottom of screen after list (no matter how long it is, there should be scroll if it's too long) ListView should not be selectable, I don't want row selection row delete button should be selectable (focusable) with touch and with trackball And everything works except I can't focus row delete button with trackball (although it's working with touch). Can you help me? Thanks!

    Read the article

  • View overlapping with RelativeLayout on Android 1.5

    - by Justin
    I am having a problem with views overlapping in a RelativeLayout on Android 1.5... Everything is working fine on Android 1.6 and above. I do understand that Android 1.5 has some issues with RelativeLayout, but I was not able to find anything on StackOverflow or the android beginners group for my specific problem. My layout consists of four sections, each of which are made up of a TextView, a Gallery, and another TextView aligned vertically: Running Apps Recent Apps Services Processes When all four sets of these items are displayed everything works fine. However, my app allows the user to specify that some of these are not displayed. If the user turns off Running Apps, Recent Apps, or Services then the remaining sections all of a sudden overlap eachother. Here is my code for the layout. I'm not sure what I am doing wrong. When the user turns off display of a section I use the View.GONE visibility setting: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_gravity="center_vertical" android:background="@null" > <!-- Running Gallery View Items --> <TextView style="@style/TitleText" android:id="@+id/running_gallery_title_text_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:paddingLeft="1sp" android:paddingRight="10sp" android:text="@string/running_title" /> <Gallery android:id="@+id/running_gallery_id" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/running_gallery_title_text_id" android:spacing="5sp" android:clipChildren="false" android:clipToPadding="false" android:unselectedAlpha=".5" /> <TextView style="@style/SubTitleText" android:id="@+id/running_gallery_current_text_id" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/running_gallery_id" android:gravity="center_horizontal" /> <!-- Recent Gallery View Items --> <TextView style="@style/TitleText" android:id="@+id/recent_gallery_title_text_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/running_gallery_current_text_id" android:gravity="left" android:paddingLeft="1sp" android:paddingRight="10sp" android:text="@string/recent_title" /> <Gallery android:id="@+id/recent_gallery_id" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/recent_gallery_title_text_id" android:spacing="5sp" android:clipChildren="false" android:clipToPadding="false" android:unselectedAlpha=".5" /> <TextView style="@style/SubTitleText" android:id="@+id/recent_gallery_current_text_id" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/recent_gallery_id" android:gravity="center_horizontal" /> <!-- Service Gallery View Items --> <TextView style="@style/TitleText" android:id="@+id/service_gallery_title_text_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/recent_gallery_current_text_id" android:gravity="left" android:paddingLeft="1sp" android:paddingRight="10sp" android:text="@string/service_title" /> <Gallery android:id="@+id/service_gallery_id" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/service_gallery_title_text_id" android:spacing="5sp" android:clipChildren="false" android:clipToPadding="false" android:unselectedAlpha=".5" /> <TextView style="@style/SubTitleText" android:id="@+id/service_gallery_current_text_id" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/service_gallery_id" android:gravity="center_horizontal" /> </RelativeLayout> I ommitted the xml for the Processes section in a (somewhat vain) attempt to keep this shorter... What can I do to make this work in Android 1.5? I don't think it is just a matter of reordering the views in the xml because it works fine when everything is displayed.

    Read the article

  • Android ListView delete row button - focus issue

    - by Max Gontar
    I have an activity with ListView and buttons below: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <ListView android:id="@+id/lvLamps" android:layout_width="fill_parent" android:layout_height="fill_parent" android:listSelector="@null" android:choiceMode="none" android:scrollbarStyle="insideInset" android:layout_weight="1.0" /> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="0.0"> <Button android:id="@+id/btnAdd" android:background="@null" android:drawableLeft="@drawable/btn_upgrade" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableRight="@drawable/lbl_upgrade" android:textSize="0pt" android:text="" android:layout_alignParentLeft="true" android:padding="20px" /> <Button android:id="@+id/btnNext" android:background="@null" android:drawableRight="@drawable/next_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableLeft="@drawable/lbl_next" android:textSize="0pt" android:text="" android:layout_alignParentRight="true" android:padding="20px" android:visibility="gone" /> <ImageButton android:id="@+id/btnListExit" android:background="@null" android:src="@drawable/btn_x" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:padding="20px" /> </RelativeLayout> </LinearLayout> ListView row contains delete button: <?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="horizontal" android:focusable="true"> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:focusable="true"> <ImageButton android:id="@+id/btnRowDelete" android:src="@drawable/btn_x" android:background="@null" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:padding="4px" android:focusable="true" android:focusableInTouchMode="true"/> <TextView android:id="@+id/txtLampRowFrom" android:text="123" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="6pt" android:layout_toRightOf="@id/btnRowDelete" android:focusable="false" android:textColor="@color/textColor"/> <TextView android:id="@+id/txtLampRowTo" android:text="123" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="6pt" android:layout_toRightOf="@id/btnRowDelete" android:layout_alignParentBottom="true" android:focusable="false" android:textColor="@color/textColor"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/arrow_upgrade_to" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:focusable="false"/> </RelativeLayout> </LinearLayout> In Adapter, Button onClickListener is set, also there are dummies to make list non-selectable: // disabling list items select public boolean areAllItemsEnabled() { return false; } public boolean isEnabled(int position) { return false; } What I want is: always show buttons in the bottom of screen after list (no matter how long it is, there should be scroll if it's too long) ListView should not be selectable, I don't want row selection row delete button should be selectable (focusable) with touch and with trackball And everything works except I can't focus row delete button with trackball (although it's working with touch). Can you help me? Thanks!

    Read the article

  • Programming an Android Button to update EditText views

    - by bergler77
    Ok guys, I have a button in android that i'm trying to use to update 8 EditText Views with different random numbers. Everything works up until I click the button. It appears I am missing a resource according to the debugger, but I'm not sure what. I've tried several different ways of implementing the button. Here is what I have after looking at several posts. import java.util.Random; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; public class MyCharNewChar extends MyCharActivity { private OnClickListener randomButtonListener = new OnClickListener(){ public void onClick(View v) { //Button creates a set of random numbers and updates the values //of the EditText views. Random rand = new Random(); int STR = 1 + rand.nextInt(12); int AGI = 1 + rand.nextInt(12); int DEX = 1 + rand.nextInt(12); int WIS = 1 + rand.nextInt(12); int INT = 1 + rand.nextInt(12); int CON = 1 + rand.nextInt(12); int HP = 1 + rand.nextInt(20); int AC = 1 + rand.nextInt(6); EditText str = (EditText) findViewById(R.id.str); str.setText(STR); EditText agi = (EditText) findViewById(R.id.agi); agi.setText(AGI); EditText dex = (EditText) findViewById(R.id.dex); dex.setText(DEX); EditText wis = (EditText) findViewById(R.id.wis); wis.setText(WIS); EditText intel = (EditText) findViewById(R.id.intel); intel.setText(INT); EditText con = (EditText) findViewById(R.id.con); con.setText(CON); EditText hp = (EditText) findViewById(R.id.baseHP); hp.setText(HP); EditText ac = (EditText) findViewById(R.id.baseAC); ac.setText(AC); } }; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.newchar); Button randomButton = (Button) findViewById(R.id.randomButton); randomButton.setOnClickListener(randomButtonListener); } } Here is the xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayoutNew1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/background" > <TextView android:id="@+id/newCharLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/new_character_screen" android:textSize="24dp" android:textColor="@color/splash" android:textStyle="bold" android:gravity="center"/> <TextView android:id="@+id/nameLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/nameLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:inputType="textPersonName" > <requestFocus /> </EditText> <TableLayout android:id="@+id/statsLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp"> <TableRow android:id="@+id/tableRow01" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp"> <TextView android:id="@+id/strLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/str" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number" /> <TextView android:id="@+id/agiLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/agiLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/agi" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> <TextView android:id="@+id/dexLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/dexLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/dex" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> </TableRow> <TableRow android:id="@+id/tableRow02" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp"> <TextView android:id="@+id/intLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/intLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/intel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> <TextView android:id="@+id/wisLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/wisLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/wis" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> <TextView android:id="@+id/conLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/conLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/con" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> </TableRow> </TableLayout> <LinearLayout android:id="@+id/linearlayoutNew02" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" android:gravity="center"> <TextView android:id="@+id/baseHPLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hpLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/baseHP" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> <TextView android:id="@+id/baseACLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/acLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/baseAC" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> </LinearLayout> <LinearLayout android:id="@+id/linearlayoutNew03" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/randomButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/randomButton" android:textSize="16dp" android:clickable="true"/> </LinearLayout> </LinearLayout> I have also tried setting the onClick in xml to setup a specific onClick method. Still the same error so I must have a problem elsewhere. Any suggestions would be great!

    Read the article

  • android app working on simulator but not on phone

    - by raqz
    i have this app that i developed and it works great on the simulator with no errors what so ever. but the moment i try to run the same on the phone for testing, the app crashes stating filenotfoundexception. it says the file /res/drawable/divider_horizontal.9.png is missing. but actually speaking, i have never referenced that file through my code. i believe its a system/os file that is unavailable. i have a custom list view, i guess its the divider there... could somebody please suggest what is wrong here. i believe this is a similar issue discussed here..but i am unable to make any sense out of it http://code.google.com/p/transdroid/issues/detail?id=14 the listview.xml layout file <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:gravity="left|center" android:layout_width="wrap_content" android:paddingBottom="5px" android:paddingTop="5px" android:paddingLeft="5px" > <ImageView android:id="@+id/linkImage" 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/firstLineView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:textColor="#FFFF00" android:text="first line title"></TextView> <TextView android:id="@+id/secondLineView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="second line title" android:layout_marginLeft="10px" android:gravity="center" android:textColor="#0099CC"></TextView> </LinearLayout> </LinearLayout> the main xml file that calls the listview.xml <?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 android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="40px"> <Button android:id="@+id/todayButton" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Today" android:textSize="12sp" android:gravity="center" android:layout_weight="1" /> <Button android:id="@+id/tomorrowButton" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Tomorrow" android:textSize="12sp" android:layout_weight="1" /> <Button android:id="@+id/WeekButton" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Future" android:textSize="12sp" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:id="@+id/listLayout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:id="@+id/ListView01" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <TextView android:id="@id/android:empty" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="No Results" /> </LinearLayout> </LinearLayout> </FrameLayout> and the code for the same is private class EfficientAdapter extends BaseAdapter{ private LayoutInflater mInflater; private String eventTitleArray[]; private String eventDateArray[]; private String eventImageLinkArray[]; public EfficientAdapter(Context context,String[] eventTitleArray,String[] eventDateArray, String[] eventImageLinkArray){ mInflater = LayoutInflater.from(context); this.eventDateArray=eventDateArray; this.eventTitleArray=eventTitleArray; this.eventImageLinkArray =eventImageLinkArray; } public int getCount(){ //return XmlParser.todayEvents.size()-1; return this.eventDateArray.length; } public Object getItem(int position){ return position; } public long getItemId(int position){ return position; } public View getView(int position, View convertView, ViewGroup parent){ ViewHolder holder; if(convertView == null){ convertView = mInflater.inflate(R.layout.listview,null); holder = new ViewHolder(); holder.firstLine = (TextView) convertView.findViewById(R.id.firstLineView); holder.secondLine = (TextView) convertView.findViewById(R.id.secondLineView); holder.imageView = (ImageView) convertView.findViewById(R.id.linkImage); //holder.checkbox = (CheckBox) convertView.findViewById(R.id.star); holder.firstLine.setFocusable(false); holder.secondLine.setFocusable(false); holder.imageView.setFocusable(false); //holder.checkbox.setFocusable(false); convertView.setTag(holder); }else{ holder = (ViewHolder) convertView.getTag(); } Log.i(tag, "Creating the list"); holder.firstLine.setText(this.eventTitleArray[position]); holder.secondLine.setText(this.eventDateArray[position]); Bitmap bitmap; try { bitmap = BitmapFactory.decodeStream((InputStream)new URL("http://eventur.sis.pitt.edu/images/heinz7.jpg").getContent()); } catch (MalformedURLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (Exception e1) { // TODO Auto-generated catch block bitmap = BitmapFactory.decodeFile("assets/heinz7.jpg");//decodeFile(getResources().getAssets().open("icon.png")); e1.printStackTrace(); } try { try{ bitmap = BitmapFactory.decodeStream((InputStream)new URL(this.eventImageLinkArray[position]).getContent());} catch(Exception e){ bitmap = BitmapFactory.decodeStream((InputStream)new URL("http://eventur.sis.pitt.edu/images/heinz7.jpg").getContent()); } int width = 0; int height =0; int newWidth = 50; int newHeight = 40; try{ width = bitmap.getWidth(); height = bitmap.getHeight(); } catch(Exception e){ width = 50; height = 40; } float scaleWidth = ((float)newWidth)/width; float scaleHeight = ((float)newHeight)/height; Matrix mat = new Matrix(); mat.postScale(scaleWidth, scaleHeight); try{ Bitmap newBitmap = Bitmap.createBitmap(bitmap,0,0,width,height,mat,true); BitmapDrawable bmd = new BitmapDrawable(newBitmap); holder.imageView.setImageDrawable(bmd); holder.imageView.setScaleType(ScaleType.CENTER); } catch(Exception e){ } } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return convertView; } class ViewHolder{ TextView firstLine; TextView secondLine; ImageView imageView; //CheckBox checkbox; } The stack trace 12-12 22:55:25.022: ERROR/AndroidRuntime(11069): Uncaught handler: thread main exiting due to uncaught exception 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.LayoutInflater.createView(LayoutInflater.java:512) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.LayoutInflater.rInflate(LayoutInflater.java:617) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at com.eventur.MainActivity$EfficientAdapter.getView(MainActivity.java:566) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.AbsListView.obtainView(AbsListView.java:1274) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.ListView.makeAndAddView(ListView.java:1661) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.ListView.fillDown(ListView.java:610) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.ListView.fillFromTop(ListView.java:673) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.ListView.layoutChildren(ListView.java:1519) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.AbsListView.onLayout(AbsListView.java:1113) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.View.layout(View.java:6156) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.View.layout(View.java:6156) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.View.layout(View.java:6156) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.View.layout(View.java:6156) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.View.layout(View.java:6156) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.View.layout(View.java:6156) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.View.layout(View.java:6156) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.ViewRoot.performTraversals(ViewRoot.java:950) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.ViewRoot.handleMessage(ViewRoot.java:1529) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.os.Handler.dispatchMessage(Handler.java:99) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.os.Looper.loop(Looper.java:123) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.app.ActivityThread.main(ActivityThread.java:3977) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at java.lang.reflect.Method.invokeNative(Native Method) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at java.lang.reflect.Method.invoke(Method.java:521) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at dalvik.system.NativeStart.main(Native Method) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): Caused by: java.lang.reflect.InvocationTargetException 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.ImageView.<init>(ImageView.java:128) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at java.lang.reflect.Constructor.constructNative(Native Method) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at java.lang.reflect.Constructor.newInstance(Constructor.java:446) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.view.LayoutInflater.createView(LayoutInflater.java:499) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): ... 42 more 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/divider_horizontal_dark.9.png from drawable resource ID #0x7f020001 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.content.res.Resources.loadDrawable(Resources.java:1643) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.content.res.TypedArray.getDrawable(TypedArray.java:548) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.widget.ImageView.<init>(ImageView.java:138) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): ... 46 more 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): Caused by: java.io.FileNotFoundException: res/drawable/divider_horizontal_dark.9.png 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.content.res.AssetManager.openNonAssetNative(Native Method) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.content.res.AssetManager.openNonAsset(AssetManager.java:417) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): at android.content.res.Resources.loadDrawable(Resources.java:1636) 12-12 22:55:25.212: ERROR/AndroidRuntime(11069): ... 48 more

    Read the article

  • Android image click in horizontal page view

    - by JaseemAmeer
    I've implemented horizontal page view with many images. And I'm trying to create a click event on the image. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pbase); ImageView binfo,bheacno; tvHeacno=(TextView) findViewById(R.id.tvheacno); heacno=getHeacno(); tvHeacno.setText(heacno); MyPagerAdapter adapter=new MyPagerAdapter(); ViewPager myPager=(ViewPager)findViewById(R.id.mythreepanelpager); myPager.setAdapter(adapter); myPager.setCurrentItem(0); binfo=(ImageView) findViewById(R.id.ivinfo); bheacno=(ImageView) findViewById(R.id.ivheacno); binfo.setOnClickListener(this); bheacno.setOnClickListener(this); } then i've MyPagerAdapter class and the onclik method. it returns null to binfo and hence fails at binfo.setOnClickListener(this) I've done image click before on normal pages successfully. Is it because of horizontal page views? How can I solve this issue?? <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_weight="33" android:layout_gravity="top" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_weight="33" android:layout_gravity="center_horizontal" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivinfo" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/information" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text=" Information " /> </LinearLayout> <LinearLayout android:layout_weight="33" android:layout_gravity="center_horizontal" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivheacno" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/heacno" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text="Get HEAC Number" /> </LinearLayout> <LinearLayout android:layout_weight="33" android:layout_gravity="center_horizontal" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivpi" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/pi" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text="Personal Information" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_weight="33" android:layout_gravity="center" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_weight="33" android:layout_gravity="left" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivassn" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/assn" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text="Add Social Security Number" /> </LinearLayout> <LinearLayout android:layout_weight="33" android:layout_gravity="left" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivvssn" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/vssn" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text="View Social Security Number" /> </LinearLayout> <LinearLayout android:layout_weight="33" android:layout_gravity="left" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivdssn" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/dssn" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text="Delete Social Security Number" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_weight="33" android:layout_gravity="bottom" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_weight="33" android:layout_gravity="left" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivali" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/ali" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text="Add Low Income" /> </LinearLayout> <LinearLayout android:layout_weight="33" android:layout_gravity="left" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivvli" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/vli" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text="View Low Income" /> </LinearLayout> <LinearLayout android:layout_weight="33" android:layout_gravity="left" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:gravity="center" android:layout_weight="50" android:id="@+id/ivdli" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_height="wrap_content" android:src="@drawable/dli" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textColor="@android:color/black" android:layout_weight="50" android:layout_gravity="center" android:gravity="center" android:text="Delete Low Income" /> </LinearLayout> </LinearLayout> </LinearLayout>

    Read the article

  • Why is android:FLAG_BLUR_BEHIND creating a gradient background in my new activity instead of bluring

    - by nderraugh
    Hi, I've got two activities. One is supposed to be a blur in front of the other. The background activity has several ImageViews which are set up as thin gradients extending across most of the screen and 10dip high. When I start the second activity it sets the background as a gradient occupying the entire window space, that is it appears to be fill_parent'd for both height and width. If I comment out the ImageViews then it blurs and looks as expected. Any thoughts? Here's the code doing the blur. import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager; import android.view.View.OnClickListener; public class TransluscentBlurSummaryB extends Activity { @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND); getWindow().getAttributes().dimAmount = 0.5f; getWindow().setFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND, WindowManager.LayoutParams.FLAG_DIM_BEHIND); setContentView(R.layout.sheetbdetails); OnClickListener clickListener = new OnClickListener() { public void onClick(View v) { TransluscentBlurSummaryB.this.finish(); } }; findViewById(R.id.sheetbdetailstable).setOnClickListener(clickListener); } } And here's the layout with the ImageView gradients. <?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" android:id="@+id/summarysparent" > <!-- view1 goes on top --> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/view2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"> <Button android:layout_height="wrap_content" android:id="@+id/ButtonBack" android:layout_width="wrap_content" android:text="Back" android:width="100dp"></Button> <Button android:layout_height="wrap_content" android:id="@+id/ButtonNext" android:layout_width="wrap_content" android:layout_alignParentRight="true" android:text="Start Over" android:width="100dp"></Button> </RelativeLayout> <TextView android:id="@+id/view1" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_width="wrap_content" android:layout_centerHorizontal="true" android:textSize="10pt" android:text="Summary"/> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/summaryscrollview" android:layout_below="@+id/view1" android:layout_above="@+id/view2"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/summarydetails" > <!-- view2 goes on the bottom --> <TextView android:id="@+id/textview2" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/view1" android:layout_centerHorizontal="true" android:text="Recommended Child Support Order" android:layout_marginTop="10dip" /> <ImageView android:id="@+id/horizontalLine1" android:layout_width="fill_parent" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_height="10dip" android:src="@drawable/black_white_gradient" android:layout_below="@+id/textview2" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview3" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/horizontalLine1" android:layout_centerHorizontal="true" android:text="You" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview10" android:layout_height="wrap_content" android:layout_width="150dp" android:layout_below="@+id/textview3" android:layout_centerHorizontal="true" android:layout_marginTop="10dip" android:gravity="center_horizontal" /> <ImageView android:id="@+id/horizontalLine2" android:layout_width="fill_parent" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_height="10dip" android:src="@drawable/black_white_gradient" android:layout_below="@+id/textview10" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview4" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/horizontalLine2" android:layout_centerHorizontal="true" android:text="Other Parent" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview11" android:layout_height="wrap_content" android:layout_width="150dp" android:layout_below="@+id/textview4" android:layout_centerHorizontal="true" android:layout_marginTop="10dip" android:text="$536.18" android:gravity="center_horizontal" /> <ImageView android:id="@+id/horizontalLine3" android:layout_width="fill_parent" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_height="10dip" android:src="@drawable/black_white_gradient" android:layout_below="@+id/textview11" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview5" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/horizontalLine3" android:layout_centerHorizontal="true" android:text="Calculation Details" android:layout_marginTop="15dip" /> <ImageView android:id="@+id/infoButton" android:src="@drawable/ic_menu_info_details" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/horizontalLine3" android:layout_toRightOf="@+id/textview5" android:clickable="true" /> <ImageView android:id="@+id/horizontalLine4" android:layout_width="fill_parent" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_height="10dip" android:src="@drawable/black_white_gradient" android:layout_below="@+id/textview5" android:layout_marginTop="18dip" /> </RelativeLayout> </ScrollView> </RelativeLayout> The gradient drawable is this. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#FFFFFF" android:centerColor="#000000" android:endColor="#FFFFFF" android:angle="270"/> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:radius="8dp" /> </shape> And here's the layout from the activity doing the blurring on top. <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/sheetbdetails" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" > <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="vertical" android:shrinkColumns="0" android:id="@+id/sheetbdetailstable" > <TableRow> <TextView android:padding="3dip" /> <TextView android:text="You" android:padding="3dip" /> <TextView android:text="@string/otherparent" android:padding="3dip" /> <TextView android:text="Combined" android:padding="3dip" /> </TableRow> </TableLayout> </ScrollView> The transparent windows are themed from styles.xml in the apidemos using @style/Theme.Transparent.

    Read the article

  • Android Uncaught Exception

    - by Agrim Asthana
    09-30 02:32:31.474: D/ddm-heap(214): Got feature list request 09-30 02:32:31.634: D/AndroidRuntime(214): Shutting down VM 09-30 02:32:31.634: W/dalvikvm(214): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 09-30 02:32:31.634: E/AndroidRuntime(214): Uncaught handler: thread main exiting due to uncaught exception 09-30 02:32:31.654: E/AndroidRuntime(214): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mjcet.mjcet/com.mjcet.mjcet.MJCET}: java.lang.ClassNotFoundException: com.mjcet.mjcet.MJCET in loader dalvik.system.PathClassLoader@44e8c820 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.os.Handler.dispatchMessage(Handler.java:99) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.os.Looper.loop(Looper.java:123) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.main(ActivityThread.java:4363) 09-30 02:32:31.654: E/AndroidRuntime(214): at java.lang.reflect.Method.invokeNative(Native Method) 09-30 02:32:31.654: E/AndroidRuntime(214): at java.lang.reflect.Method.invoke(Method.java:521) 09-30 02:32:31.654: E/AndroidRuntime(214): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 09-30 02:32:31.654: E/AndroidRuntime(214): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 09-30 02:32:31.654: E/AndroidRuntime(214): at dalvik.system.NativeStart.main(Native Method) 09-30 02:32:31.654: E/AndroidRuntime(214): Caused by: java.lang.ClassNotFoundException: com.mjcet.mjcet.MJCET in loader dalvik.system.PathClassLoader@44e8c820 09-30 02:32:31.654: E/AndroidRuntime(214): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 09-30 02:32:31.654: E/AndroidRuntime(214): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 09-30 02:32:31.654: E/AndroidRuntime(214): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409) 09-30 02:32:31.654: E/AndroidRuntime(214): ... 11 more 09-30 02:32:31.684: I/dalvikvm(214): threadid=7: reacting to signal 3 09-30 02:32:31.684: E/dalvikvm(214): Unable to open stack trace file '/data/anr/traces.txt': Permission denied the above is my debugging output for the below activities LOGINACTIVITY.java package com.agrim.mjcet; import com.agrim.mjcet.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; //import android.widget.TextView; import android.widget.Button; import android.widget.EditText; import android.view.View.OnClickListener; public class LoginActivity extends Activity { EditText txtUserName; EditText txtPassword; Button btnLogin; Button btnCancel; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setting default screen to login.xml setContentView(R.layout.main); txtUserName=(EditText)this.findViewById(R.id.txtUname); txtPassword=(EditText)this.findViewById(R.id.txtPwd); btnLogin=(Button)this.findViewById(R.id.btnLogin); btnLogin=(Button)this.findViewById(R.id.btnLogin); btnLogin.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Switching to Register screen if((txtUserName.getText().toString()).equals(txtPassword.getText().toString())) { Intent myIntent = new Intent(getApplicationContext(),SampleActivity.class); startActivityForResult(myIntent, 0); } } } ); } } SAMPLE ACTIVITY.java package com.agrim.mjcet; import com.agrim.mjcet.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class SampleActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set View to register.xml setContentView(R.layout.lol); TextView HomeScreen = (TextView) findViewById(R.id.back); HomeScreen.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { // Closing registration screen // Switching to Login Screen/closing register screen finish(); } }); } } and here are my 2 layouts MAIN.XML <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" android:stretchColumns="1"> <TableRow> <TextView android:text="@string/user_name" android:textColor="#347235" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_marginLeft="25dip" android:layout_height="wrap_content"> </TextView> <EditText android:text="" android:inputType="text" android:id="@+id/txtUname" android:layout_weight="0.75" android:layout_width="wrap_content" android:layout_marginRight="10dip" android:layout_marginBottom="5dip" android:background="#FFFFFF" android:layout_height="wrap_content"> </EditText> </TableRow> <TableRow> <TextView android:text="@string/password" android:textColor="#347235" android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="25dip"> </TextView> <EditText android:text="" android:inputType="textPassword" android:id="@+id/txtPwd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="10dip" android:layout_weight="1" android:background="#FFFFFF" android:gravity="center"> </EditText> </TableRow> <TableRow> <Button android:id="@+id/btnLogin" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#FFFFFF" android:layout_marginTop="25dip" android:layout_marginLeft="50dip" android:onClick="onClickMyButton" android:text="@string/login" /> <Button android:id="@+id/btnCancel" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#FFFFFF" android:layout_marginTop="25dip" android:layout_marginLeft="100dip" android:layout_marginRight="50dip" android:text="@string/cancel" /> </TableRow> <FrameLayout android:layout_width="wrap_content" android:layout_height="match_parent" > <ImageView android:layout_width="fill_parent" android:layout_height="match_parent" android:scaleType="centerInside" android:src="@drawable/logo_invert" android:contentDescription="@drawable/logo_invert"/> </FrameLayout> </TableLayout> and finally LOL.xml <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:background="#000000" android:layout_height="fill_parent" > <ImageView android:layout_width="fill_parent" android:id="@+id/back" android:layout_height="match_parent" android:scaleType="centerInside" android:src="@drawable/lol" android:contentDescription="@drawable/lol"> </ImageView> <RelativeLayout android:layout_width="match_parent" android:layout_height="138dp" android:orientation="vertical" android:gravity="bottom" > <TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:text="@string/coming_soon" android:textColor="#347235" /> </RelativeLayout> </FrameLayout> I get a force close upon initialization.. and yes this is my first android app :)

    Read the article

  • Android accessibility focus - clicking a view changes focus to previous view

    - by benkdev
    I'm using android TalkBack to test my application for accessibility use. When I swipe to select a view and double tap, the focus returns the the view above it. Usually when swiping to a view and double clicking it, onClick is called. What am I doing wrong? <?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" android:background="@color/all_white" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/header" android:scaleType="center" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/green_bar" android:scaleType="center" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/blue_bar" android:scaleType="center" /> <EditText android:id="@+id/username" android:layout_width="325dp" android:layout_height="wrap_content" android:hint="@string/username" android:focusable="true" android:nextFocusDown="@id/password" /> <EditText android:id="@+id/password" android:inputType="textPassword" android:layout_width="325dp" android:layout_height="wrap_content" android:hint="@string/password" android:focusable="true" android:nextFocusUp="@id/username" android:nextFocusDown="@id/login" /> <Button android:id="@+id/login" android:onClick="doLogin" android:focusable="true" android:layout_width="325dp" android:layout_height="wrap_content" android:text="@string/login" android:nextFocusUp="@id/password" android:nextFocusDown="@id/create_trial_account" /> <Button android:id="@+id/create_trial_account" android:layout_width="100dip" android:layout_height="wrap_content" android:text="@string/new_user" android:onClick="createAccount" android:focusable="true" android:nextFocusUp="@id/login" /> <TextView android:id="@+id/copyright" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/copyright" /> <TextView android:id="@+id/buildNumber" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout>

    Read the article

  • Android Form Design Overlaping

    - by Mashfuk
    In My Project I have to built a registration form like the following. But when I design the form it overlays some item. How can I easily design registration form in android. How can I solve this? Thanks in advanced. <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ScrollView1" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF" > <TextView android:text="Registration Form" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"> </TextView> <View android:layout_below="@id/textView1" android:background="#000000" android:layout_height="1dp" android:id="@+id/view1" android:layout_width="fill_parent" > </View> <!-- Child Menu Section of Registration Form --> <RelativeLayout android:layout_below="@id/textView1" android:id="@+id/rlKidsMenuRegForm" android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:layout_alignParentLeft="true" android:text="Do you use the kids MENU?" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/textView2"> </TextView> <EditText android:layout_toRightOf="@id/textView2" android:textSize="10sp" android:layout_height="15dp" android:text="EditText" android:id="@+id/editText1" android:layout_width="wrap_content"> </EditText> <EditText android:layout_height="wrap_content" android:text="EditText" android:textSize="10sp" android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_below="@id/editText1"> </EditText> <EditText android:layout_toRightOf="@id/editText2" android:layout_below="@id/editText1" android:layout_height="wrap_content" android:textSize="10sp" android:text="EditText" android:id="@+id/editText3" android:layout_width="wrap_content"> </EditText> <View android:layout_below="@id/editText3" android:background="#000000" android:layout_height="1dp" android:id="@+id/view1" android:layout_width="fill_parent" > </View> </RelativeLayout> <!-- Mid Section of Registration Form --> <RelativeLayout android:layout_below="@id/rlKidsMenuRegForm" android:id="@+id/rlMidRegForm" android:layout_height="wrap_content" android:layout_width="fill_parent" android:background="#FFFFFF" > <EditText android:layout_alignParentLeft="true" android:layout_height="wrap_content" android:text="EditText" android:id="@+id/editText4" android:layout_width="wrap_content"> </EditText> <EditText android:layout_height="wrap_content" android:text="EditText" android:id="@+id/editText5" android:layout_width="wrap_content" android:layout_toRightOf="@id/editText4"> </EditText> <TextView android:text="TextView" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:id="@+id/textView3" android:layout_below="@id/editText5" > </TextView> <EditText android:layout_height="wrap_content" android:text="EditText" android:id="@+id/editText5" android:layout_width="fill_parent" android:layout_below="@id/textView3"> </EditText> <TextView android:text="TextView" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:layout_below="@id/editText5" android:id="@+id/textView3" > </TextView> <TextView android:text="TextView" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_width="wrap_content" android:id="@+id/textView3" android:layout_below="@id/textView3" > </TextView> </RelativeLayout> </RelativeLayout> </ScrollView>

    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 table width queries

    - by user1653285
    I have a table layout (code below), but I have am having a bit of a problem with the width of the cells. The picture below shows the problem. There should be a white border on the right hand side of the screen. I also want the text "Auditorium" not to wrap onto a new line (I would prefer that "13th -" get put onto the new line instead, I don't want to put \n in there because then it would mean it goes onto a new line at that point on bigger screens/landscape view). How can I fix those two problems? <?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="#013567" > <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:shrinkColumns="*" android:stretchColumns="*" > <TableRow android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/meeting_5" android:textColor="#fff" > </TextView> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/meeting_5_date" android:textColor="#fff" > </TextView> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/meeting_5_location" android:textColor="#fff" > </TextView> </TableRow> <TableRow android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/AGM" android:textColor="#fff" > </TextView> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/AGM_date" android:textColor="#fff" > </TextView> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/AGM_location" android:textColor="#fff" > </TextView> </TableRow> </TableLayout>

    Read the article

  • Andorid: the keyboard appeares when the app is started

    - by Briesanji
    I have coded an Android application composed by a LinearLayout(with an editbox and a button) and a ScrollView(with a LinearLayout that contains a TextView). When the app is started the keyboard pops up immediatly and I don't want this to happen. Have you got some advice?? THIS IS MY LAYOUT : <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.b2875.Messaggi$PlaceholderFragment" > <LinearLayout android:layout_width="fill_parent" android:layout_height="70dp" android:layout_marginTop="650dp" > <EditText android:id="@+id/ScriviMessaggio" android:layout_width="332dp" android:layout_height="71dp" android:ems="10" android:hint="@string/scriviMessaggio" /> <Button android:id="@+id/invia" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/invia" /> </LinearLayout> <ScrollView android:id="@+id/scrollView1" android:scrollbarAlwaysDrawVerticalTrack="true" android:layout_width="fill_parent" android:layout_height="600dp" android:focusable="true" android:focusableInTouchMode="true" > <LinearLayout android:id="@+id/linearVertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/AreaMessaggi" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/messaggi" /> </LinearLayout> </ScrollView> </RelativeLayout> MY MANIFEST IS THIS: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.b2875" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" /> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:windowSoftInputMode="stateHidden" android:name="com.example.b2875.Messaggi" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>

    Read the article

  • Android 1.5 Gridview Problem

    - by flybirdtt
    I used a gridview in this app. When i run it at Verison 1.6 or newer, it's OK. But i can not get this gridview in 1.5. I always show this info and exception: Unable to resolve drawable "com.android.layoutlib.utils.DensityBasedResourceValue@397660" in attribute "listSelector" org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: tag requires a 'drawable' attribute or child tag defining a drawable at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:151) at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:779) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:720) at com.android.layoutlib.bridge.ResourceHelper.getDrawable(ResourceHelper.java:150) at com.android.layoutlib.bridge.BridgeTypedArray.getDrawable(BridgeTypedArray.java:668) at android.widget.AbsListView.(AbsListView.java:514) at android.widget.GridView.(GridView.java:69) at android.widget.GridView.(GridView.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at android.view.LayoutInflater.createView(LayoutInflater.java:499) at android.view.BridgeInflater.onCreateView(BridgeInflater.java:77) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122) at android.view.LayoutInflater.rInflate(LayoutInflater.java:617) at android.view.LayoutInflater.rInflate(LayoutInflater.java:620) at android.view.LayoutInflater.inflate(LayoutInflater.java:407) at android.view.LayoutInflater.inflate(LayoutInflater.java:296) at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:377) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.activated(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source) at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1076) at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:601) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.selectDefaultPage(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.addPages(Unknown Source) at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138) at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180) at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270) at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473) at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256) at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209) at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608) at org.eclipse.ui.internal.PartStack.add(PartStack.java:499) at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103) at org.eclipse.ui.internal.PartStack.add(PartStack.java:485) at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112) at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63) at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225) at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213) at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:778) at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:677) at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:638) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2854) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2762) at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2754) at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2705) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2701) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2685) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2676) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:361) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526) at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:842) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.runtime.Platform.run(Platform.java:888) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:840) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1101) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1205) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) This is the layout xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/menu_background2"> <LinearLayout android:id="@+id/logopanel" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginTop="50dip" android:gravity="center" android:layout_marginBottom="10dip"> <ImageButton android:id="@+id/searchbar" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/fake_search_bar"></ImageButton> </LinearLayout> <LinearLayout android:id="@+id/iconpanel" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/logopanel" android:layout_above="@+id/allbotpanel" android:layout_marginTop="10dip"> <GridView android:id="@+id/gridcontent" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:numColumns="3" android:layout_gravity="center" android:layout_centerInParent="true" android:background="@drawable/transparent_backgroud" android:listSelector="@drawable/gridviewselector"> </GridView> </LinearLayout> <RelativeLayout android:id="@+id/allbotpanel" android:layout_width="fill_parent" android:layout_height="75dip" android:background="@drawable/amex_bottom_bar" android:layout_alignParentBottom="true"> <LinearLayout android:id="@+id/noticebar" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="29dip" android:layout_above="@+id/homebottombar"> <ImageButton android:id="@+id/infoicon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:layout_marginLeft="10dip" android:background="@drawable/amex_info_button" android:src="@drawable/infoselector"></ImageButton> <TextView android:id="@+id/noticeicon" android:gravity="center" android:layout_gravity="right|center_vertical" android:layout_width="wrap_content" android:layout_height="25dip" android:layout_weight="1" android:clickable="true" android:focusable="true" android:text="@string/notice_string"></TextView> </LinearLayout> <LinearLayout android:id="@+id/homebottombar" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="46dip" android:gravity="center" android:layout_alignParentBottom="true" android:background="@drawable/amex_bottom_bar" android:layout_marginBottom="3dip"></LinearLayout> </RelativeLayout> </RelativeLayout>

    Read the article

  • Android 1.5 Gridview Problem,Pls help me.Thanks

    - by flybirdtt
    I used a gridview in this app.The xml file like this: When i run it at Verison 1.6 or newer. it's ok. But i can not get this gridview in 1.5 I always show this info and exception: Unable to resolve drawable "com.android.layoutlib.utils.DensityBasedResourceValue@397660" in attribute "listSelector" org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: tag requires a 'drawable' attribute or child tag defining a drawable at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:151) at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:779) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:720) at com.android.layoutlib.bridge.ResourceHelper.getDrawable(ResourceHelper.java:150) at com.android.layoutlib.bridge.BridgeTypedArray.getDrawable(BridgeTypedArray.java:668) at android.widget.AbsListView.(AbsListView.java:514) at android.widget.GridView.(GridView.java:69) at android.widget.GridView.(GridView.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at android.view.LayoutInflater.createView(LayoutInflater.java:499) at android.view.BridgeInflater.onCreateView(BridgeInflater.java:77) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122) at android.view.LayoutInflater.rInflate(LayoutInflater.java:617) at android.view.LayoutInflater.rInflate(LayoutInflater.java:620) at android.view.LayoutInflater.inflate(LayoutInflater.java:407) at android.view.LayoutInflater.inflate(LayoutInflater.java:296) at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:377) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.activated(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source) at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1076) at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:601) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.selectDefaultPage(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.addPages(Unknown Source) at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138) at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180) at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270) at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473) at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256) at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209) at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608) at org.eclipse.ui.internal.PartStack.add(PartStack.java:499) at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103) at org.eclipse.ui.internal.PartStack.add(PartStack.java:485) at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112) at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63) at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225) at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213) at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:778) at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:677) at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:638) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2854) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2762) at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2754) at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2705) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2701) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2685) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2676) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:361) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526) at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:842) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.runtime.Platform.run(Platform.java:888) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:840) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1101) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1205) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) This is the layout xml: &RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/menu_background2"& &LinearLayout android:id="@+id/logopanel" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginTop="50dip" android:gravity="center" android:layout_marginBottom="10dip"& &ImageButton android:id="@+id/searchbar" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/fake_search_bar"&&/ImageButton& &/LinearLayout& &LinearLayout android:id="@+id/iconpanel" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/logopanel" android:layout_above="@+id/allbotpanel" android:layout_marginTop="10dip"& &GridView android:id="@+id/gridcontent" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:numColumns="3" android:layout_gravity="center" android:layout_centerInParent="true" android:background="@drawable/transparent_backgroud" android:listSelector="@drawable/gridviewselector"& &/GridView& &/LinearLayout& &RelativeLayout android:id="@+id/allbotpanel" android:layout_width="fill_parent" android:layout_height="75dip" android:background="@drawable/amex_bottom_bar" android:layout_alignParentBottom="true"& &LinearLayout android:id="@+id/noticebar" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="29dip" android:layout_above="@+id/homebottombar"& &ImageButton android:id="@+id/infoicon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:layout_marginLeft="10dip" android:background="@drawable/amex_info_button" android:src="@drawable/infoselector"&&/ImageButton& &TextView android:id="@+id/noticeicon" android:gravity="center" android:layout_gravity="right|center_vertical" android:layout_width="wrap_content" android:layout_height="25dip" android:layout_weight="1" android:clickable="true" android:focusable="true" android:text="@string/notice_string"&&/TextView& &/LinearLayout& &LinearLayout android:id="@+id/homebottombar" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="46dip" android:gravity="center" android:layout_alignParentBottom="true" android:background="@drawable/amex_bottom_bar" android:layout_marginBottom="3dip"&&/LinearLayout& &/RelativeLayout& &/RelativeLayout&

    Read the article

  • Android -Layout Manager not showing buttons

    - by Arun
    The following is my code. I want an interface where I have a single line textbox, a multiline textbox with 2 buttons below. I want the multiline textbox to occupy all the space available after rendering the buttons and textbox. For this I created two LinearLayouts inside the main layout. The first one has vertical orientation with layout_width set to fill_parent. The second one is horizontal with fill_parent again. The first one has a textbox for which I have set the layout_height to fill parent. The second one has two textboxes OK and Cancel. When I run this application I get the UI, but the Buttons are very small. I have to set the button height manually. What am I doing wrong here. I don't want to hard code the button height. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Name"></TextView> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content"></EditText> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Contents"></TextView> <EditText android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top" /> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"> <Button android:id="@+id/okbutt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="OK" android:layout_weight="1" /> <Button android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Cancel" android:layout_weight="1" /> </LinearLayout> Thanks, Arun

    Read the article

  • Android - Linear Layout arrangement, not positioning as expected

    - by Arun
    The following is my code. I want an interface where I have a single line textbox, a multiline textbox with 2 buttons below. I want the multiline textbox to occupy all the space available after rendering the buttons and textbox. For this I created two LinearLayouts inside the main layout. The first one has vertical orientation with layout_width set to fill_parent. The second one is horizontal with fill_parent again. The first one has a textbox for which I have set the layout_height to fill parent. The second one has two textboxes OK and Cancel. When I run this application I get the UI, but the Buttons are very small (about 5px in height). I have to set the button height manually. What am I doing wrong here. I don't want to hard code the button height. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Name"></TextView> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content"></EditText> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Contents"></TextView> <EditText android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top" /> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"> <Button android:id="@+id/okbutt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="OK" android:layout_weight="1" /> <Button android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Cancel" android:layout_weight="1" /> </LinearLayout> Thanks, Arun

    Read the article

  • Android: Crashed when single contact is clicked

    - by Sean Tan
    My application is always crashed at this moment, guru here please help me to solved. Thanks.The situation now is as mentioned in title above. Hereby is my AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.contactmanager" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="10" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/> <uses-permission android:name="android.permission.WRITE_OWNER_DATA"/> <uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <application android:label="@string/app_name" android:icon="@drawable/icon" android:allowBackup="true"> <!-- --><activity android:name=".ContactManager" 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="ContactAdder" android:label="@string/addContactTitle"> </activity> <activity android:name=".SingleListContact" android:label="Contact Person Details"> </activity> </application> </manifest> The SingleListContact.java package com.example.android.contactmanager; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; public class SingleListContact extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.single_list_contact_view); TextView txtContact = (TextView) findViewById(R.id.contactList); Intent i = getIntent(); // getting attached intent data String contact = i.getStringExtra("contact"); // displaying selected product name txtContact.setText(contact); } } My ContactManager.java as below /* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.android.contactmanager; import android.app.Activity; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.ContactsContract; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.ListView; import android.widget.SimpleCursorAdapter; import android.widget.TextView; public final class ContactManager extends Activity implements OnItemClickListener { public static final String TAG = "ContactManager"; private Button mAddAccountButton; private ListView mContactList; private boolean mShowInvisible; //public BooleanObservable ShowInvisible = new BooleanObservable(false); private CheckBox mShowInvisibleControl; /** * Called when the activity is first created. Responsible for initializing the UI. */ @Override public void onCreate(Bundle savedInstanceState) { Log.v(TAG, "Activity State: onCreate()"); super.onCreate(savedInstanceState); setContentView(R.layout.contact_manager); // Obtain handles to UI objects mAddAccountButton = (Button) findViewById(R.id.addContactButton); mContactList = (ListView) findViewById(R.id.contactList); mShowInvisibleControl = (CheckBox) findViewById(R.id.showInvisible); // Initialise class properties mShowInvisible = false; mShowInvisibleControl.setChecked(mShowInvisible); // Register handler for UI elements mAddAccountButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Log.d(TAG, "mAddAccountButton clicked"); launchContactAdder(); } }); mShowInvisibleControl.setOnCheckedChangeListener(new OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Log.d(TAG, "mShowInvisibleControl changed: " + isChecked); mShowInvisible = isChecked; populateContactList(); } }); mContactList = (ListView) findViewById(R.id.contactList); mContactList.setOnItemClickListener(this); // Populate the contact list populateContactList(); } /** * Populate the contact list based on account currently selected in the account spinner. */ private void populateContactList() { // Build adapter with contact entries Cursor cursor = getContacts(); String[] fields = new String[] { ContactsContract.Data.DISPLAY_NAME }; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.contact_entry, cursor, fields, new int[] {R.id.contactEntryText}); mContactList.setAdapter(adapter); } /** * Obtains the contact list for the currently selected account. * * @return A cursor for for accessing the contact list. */ private Cursor getContacts() { // Run query Uri uri = ContactsContract.Contacts.CONTENT_URI; String[] projection = new String[] { ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME }; String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '" + (mShowInvisible ? "0" : "1") + "'"; //String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '" + (mShowInvisible.get() ? "0" : "1") + "'"; String[] selectionArgs = null; String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; return this.managedQuery(uri, projection, selection, selectionArgs, sortOrder); } /** * Launches the ContactAdder activity to add a new contact to the selected account. */ protected void launchContactAdder() { Intent i = new Intent(this, ContactAdder.class); startActivity(i); } public void onItemClick(AdapterView<?> l, View v, int position, long id) { Log.i("TAG", "You clicked item " + id + " at position " + position); // Here you start the intent to show the contact details // selected item TextView tv=(TextView)v.findViewById(R.id.contactList); String allcontactlist = tv.getText().toString(); // Launching new Activity on selecting single List Item Intent i = new Intent(getApplicationContext(), SingleListContact.class); // sending data to new activity i.putExtra("Contact Person", allcontactlist); startActivity(i); } } contact_entry.xml <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <ListView android:layout_width="wrap_content" android:id="@+id/contactList" android:layout_height="0dp" android:padding="10dp" android:textSize="200sp" android:layout_weight="10"/> <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/showInvisible" android:text="@string/showInvisible"/> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/addContactButton" android:text="@string/addContactButtonLabel"/> </LinearLayout> Logcat result: 12-05 05:00:31.289: E/AndroidRuntime(642): FATAL EXCEPTION: main 12-05 05:00:31.289: E/AndroidRuntime(642): java.lang.NullPointerException 12-05 05:00:31.289: E/AndroidRuntime(642): at com.example.android.contactmanager.ContactManager.onItemClick(ContactManager.java:148) 12-05 05:00:31.289: E/AndroidRuntime(642): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 12-05 05:00:31.289: E/AndroidRuntime(642): at android.widget.ListView.performItemClick(ListView.java:3513) 12-05 05:00:31.289: E/AndroidRuntime(642): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812) 12-05 05:00:31.289: E/AndroidRuntime(642): at android.os.Handler.handleCallback(Handler.java:587) 12-05 05:00:31.289: E/AndroidRuntime(642): at android.os.Handler.dispatchMessage(Handler.java:92) 12-05 05:00:31.289: E/AndroidRuntime(642): at android.os.Looper.loop(Looper.java:123) 12-05 05:00:31.289: E/AndroidRuntime(642): at android.app.ActivityThread.main(ActivityThread.java:3683) 12-05 05:00:31.289: E/AndroidRuntime(642): at java.lang.reflect.Method.invokeNative(Native Method) 12-05 05:00:31.289: E/AndroidRuntime(642): at java.lang.reflect.Method.invoke(Method.java:507) 12-05 05:00:31.289: E/AndroidRuntime(642): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-05 05:00:31.289: E/AndroidRuntime(642): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-05 05:00:31.289: E/AndroidRuntime(642): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • onListItemClick and CheckedTextView not respoding

    - by rayman
    Hi, i got ListActivity, each item has 2 textviews image and CheckedTextView. i am trying to implement simple multichoiselist... i have two problems: 1. @Override protected void onListItemClick(android.widget.ListView l, View v, int position, long id) { ... } doesnt respond at all ive tried it with the debugger and when i press on any list item it doesnt stop there. and ive tried all kind of things (like focusable:false) two:. i cant toggle the CheckedTextView anyhow. here is my xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="100sp" android:focusable="false" android:focusableInTouchMode="false"> android:padding="6dip"> <ImageView android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/icon" android:id="@drawable/icon" android:layout_marginLeft="6dip" android:focusable="false" android:focusableInTouchMode="false"> </ImageView> <LinearLayout android:id="@+id/LinearLayout01" android:orientation="vertical" android:layout_width="1sp" android:layout_height="fill_parent" android:layout_weight="1" android:focusable="false" android:focusableInTouchMode="false"> <TextView android:id="@+id/toptext" android:layout_weight="1" android:gravity="center_vertical" android:text="OrderNum" android:singleLine="true" android:layout_height="0dp" android:layout_width="wrap_content" android:focusable="false" android:focusableInTouchMode="false"> </TextView> <TextView android:id="@+id/bottomtext" android:layout_height="wrap_content" android:layout_width="wrap_content" android:focusable="false" android:focusableInTouchMode="false" android:text="TweetMsg"> </TextView> <TextView android:id="@+id/twittLocation" android:layout_weight="1" android:text="location" android:singleLine="true" android:layout_width="fill_parent" android:layout_height="0dip" android:focusable="false" android:focusableInTouchMode="false"> </TextView> <TextView android:layout_weight="1" android:id="@+id/twittLocationlink" android:text="locationlink" android:gravity="fill_horizontal" android:layout_width="fill_parent" android:layout_height="0dip" android:focusable="false" android:focusableInTouchMode="false"> </TextView> </LinearLayout> <CheckedTextView android:id="@android:id/text1" android:text="Delete" android:layout_width="wrap_content" android:layout_marginRight="2dp" android:layout_height="fill_parent" android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:focusable="false"></CheckedTextView> </LinearLayout> any idea what's the problem? thanks.

    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] How to center buttons on screen horizontally and vertically plus equidistant apart?

    - by marc
    I've been racking my brain (android newbie here, so not hard to do) for awhile trying to figure out how to accomplish this: Desired Layout using a RelativeLayout or something other than AbsoluteLayout which is what this was created with. I'm coming from a Windows programming background where the device adjusts the 'absolute' positioning for you and GUI layout was a non-issue. The first layout works great in the emulator, but doesn't format for my Nexus One or any other screen that differs from the emulator size. I expected this because it's absolutely positioned, but haven't found a solution that will format correctly for different screen sizes. My goal is to have the layout work for different screen sizes and in portrait / landscape. Here's the Code that I'm currently using: [main.xml] <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" > <Button android:id="@+id/Button01" android:layout_width="188px" android:layout_height="100px" android:text="A" android:layout_y="50px" android:layout_x="65px" android:textSize="48sp"/> <Button android:id="@+id/Button02" android:layout_width="188px" android:layout_height="100px" android:text="B" android:layout_y="175px" android:layout_x="65px" android:textSize="48sp"/> <Button android:id="@+id/Button03" android:layout_width="188px" android:layout_height="100px" android:text="C" android:layout_y="300px" android:layout_x="65px" android:textSize="48sp"/> </AbsoluteLayout> Using tidbits from other questions here, I came up with this, it’s closer, but not there yet. <?xml version="1.0" encoding="utf-8"?> <TableLayout android:gravity="center" android:id="@+id/widget49" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" > <Button android:id="@+id/Button01" android:layout_width="0dip" android:layout_weight="1" android:text="A" android:textSize="48sp"/> <Button android:id="@+id/Button02" android:layout_width="0dip" android:layout_weight="1" android:text="B" android:textSize="48sp"/> <Button android:id="@+id/Button03" android:layout_width="0dip" android:layout_weight="1" android:text="C" android:textSize="48sp"/> </TableLayout> Here’s a picture of the TableLayout: Another Attempt Any help / guidance would be greatly appreciated.

    Read the article

  • Layout problem: how to place something on top and bottom?

    - by chow
    I want create a layout, with a horizontal LinearLayout(s) on top and bottom, a ListView fill in middle. How can I define the main.xml. I tried to create a layout with horizontal LinearLayout on top, TextView on bottom, a ListView fill in middle; is ok. But after I modified the bottom TextView to LinearLayout, the bottom LinearLayout disappear. <?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:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:textSize="12px" android:text="something here" android:layout_width="50px" android:layout_height="wrap_content" /> <TextView android:textSize="12px" android:text="something here" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="bottom" > <ListView android:id="@+id/listbody" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <LinearLayout android:orientation="horizontal" android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:layout_height="wrap_content" android:layout_width="0dip" android:layout_weight="1" android:textSize="12px" android:text="50%" /> <TextView android:layout_height="wrap_content" android:layout_width="0dip" android:layout_weight="1" android:textSize="12px" android:text="50%" /> </LinearLayout> </LinearLayout> </LinearLayout> Anybody can tell advise? Please help.

    Read the article

  • Android Layout: Display as much ImageViews as possible without scrolling

    - by Toni4780
    I am working on an app which should display several same size images on the screen. But it should only display only so much images as possible without offering scrolling. E.g. On a "big" tablet it could display 10x10 Imageviews (screen is large, so there is much space for pictures) On a "big" phone there might be enough space to display 6x6 ImageViews, so it should only display a 6x6 array of images. On a small phone there is propably only space for 4x4 ImageViews, so it should only display this. How can I make this in Android? I know about "layout-large", ... but if i make a special fixed xml-layout for a "large" device, it would not fit all devices correct. E.g. a Galaxy Nexus is a "normal" device and so is a Nexus One, but there would be at least be space for one or two more imageview rows on a Galaxy Nexus than on a Nexus One. So do I have to measure in code somehow how big the resolution is and display some TableRows accordingly? Or is there a special way how I can manage this?

    Read the article

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