android-layout

Why can't I upload a picture from gallery in my android app, if the picture was taken with the camera app from android?

浪尽此生 提交于 2021-02-11 12:22:27
问题 I want to upload an image from gallery and show it on my Android app. This works fine if I select an image from the screenshot folder for example. But when I select an image from the folder where the pics, taken with the phone camera, are stored, it does not work. public void UploadPicture(View v) { Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(pickPhoto , 1); protected void onActivityResult(int

Why can't I upload a picture from gallery in my android app, if the picture was taken with the camera app from android?

前提是你 提交于 2021-02-11 12:21:14
问题 I want to upload an image from gallery and show it on my Android app. This works fine if I select an image from the screenshot folder for example. But when I select an image from the folder where the pics, taken with the phone camera, are stored, it does not work. public void UploadPicture(View v) { Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(pickPhoto , 1); protected void onActivityResult(int

Fragment save view state

大兔子大兔子 提交于 2021-02-10 19:56:26
问题 I have some Fragment with this structure: <RelativeLayout android:id="@+id/control_panel" android:visibility="gone"> <RelativeLayout android:id="@+id/control_panel_icon"> <ImageView android:id="@+id/control_panel_icon_1" android:src="@drawable/ic_control_panel_icon_1" /> <ImageView android:id="@+id/control_panel_icon_2" android:src="@drawable/ic_control_panel_icon_2" android:visibility="gone"/> </RelativeLayout> <TextView android:id="@+id/control_panel_tv" android:text="@string/not_available"

Place a TextView next to another TextView for longer text on Android

爷,独闯天下 提交于 2021-02-10 14:33:35
问题 My goal is to have 2 TextView s ( textLeft , textRight ) next to each other. textLeft should be aligned to the left side of parent. textRight should always be an immediate right of textLeft (not on the extreme right of device), and it should not be pushed out of screen if textLeft is too long. Horizontal LinearLayout is of no use here as using weights will fix the view size, and that's not desired. I have been using this RelativeLayout which works fine if textLeft is not too long. With longer

Place a TextView next to another TextView for longer text on Android

别等时光非礼了梦想. 提交于 2021-02-10 14:31:07
问题 My goal is to have 2 TextView s ( textLeft , textRight ) next to each other. textLeft should be aligned to the left side of parent. textRight should always be an immediate right of textLeft (not on the extreme right of device), and it should not be pushed out of screen if textLeft is too long. Horizontal LinearLayout is of no use here as using weights will fix the view size, and that's not desired. I have been using this RelativeLayout which works fine if textLeft is not too long. With longer

text isn't showing after using setText() to TextView() in inflated layout

流过昼夜 提交于 2021-02-10 13:59:29
问题 Yes, I know that similar questions were asked before but I tried many of those. So I have a problem with setting text in TextView in the inflated layout. I tried setContentView() then it works but then activity_main.xml with the menu isn't working. So I tried to inflate layout with TextView that I need. When I try to setText() it just doesn't displaying it. Here is my code: public void bodAlg() { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

How to set the background image of gridlayout for each row in android?

笑着哭i 提交于 2021-02-10 13:15:58
问题 I am building an application in which i wantt to set each row of gridlayout with different image 回答1: Have a array list of images file path/url and simply call it from inside your getView method like layoutName.setBackground(imageList.get(position)); 来源: https://stackoverflow.com/questions/5828044/how-to-set-the-background-image-of-gridlayout-for-each-row-in-android

How to set the background image of gridlayout for each row in android?

依然范特西╮ 提交于 2021-02-10 13:15:30
问题 I am building an application in which i wantt to set each row of gridlayout with different image 回答1: Have a array list of images file path/url and simply call it from inside your getView method like layoutName.setBackground(imageList.get(position)); 来源: https://stackoverflow.com/questions/5828044/how-to-set-the-background-image-of-gridlayout-for-each-row-in-android

Svg not visible in device but visible in android xml

前提是你 提交于 2021-02-10 05:03:04
问题 I have used SVG's for these icons, the icons are visible in xml but not visible in device . following is my code : ` <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:gravity="center" android:orientation="horizontal" android:weightSum="10" > <ImageView android:layout_width="0dp" android:layout_height="25dp" android:layout_weight="1.5" app

Android - EditText made programmatically not showing keyboard

岁酱吖の 提交于 2021-02-09 20:23:07
问题 I am making an app where I am using a ArrayAdapter<String> and I am programmatically making an editText view inside of a Relative Layout which is all inside of a AppCompatDialogFragment . Each of the editTexts are showing up and I can click on them, but if it doesn't open the keyboard to type. I have tried things like: EditText editText = (EditText) findViewById(R.id.myTextViewId); editText.requestFocus(); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD