android-dialog

Application selection dialog based on filetype

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 16:05:10
问题 I'm trying to create a Dialog, which will display a list of availible applications to open a given filetype. I've been looking at some question here on stackoverflow that work with the same issue, but I get lost due to lacking answer. In particular I've been looking at this question: In Android, How can I display an application selector based on file type? My follow-up question is then: What to do with the List<ResolveInfo> ? How can I display the availible applications with name and icon?

“new ArrayAdapter<String>(this ” error when used in dialog null exception

懵懂的女人 提交于 2019-12-12 04:42:44
问题 hi, I have been working on a dialog box and i need a ListView inside the dialog box. The problem is i cant use "this" "new ArrayAdapter(this" Can someone help me? ListView dialog_ListView = (ListView)dialog.findViewById(R.id.list); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, comment11); dialog_ListView.setAdapter(adapter); 回答1: Maybe this workaround helps you: ListView dialog_ListView = (ListView)dialog.findViewById(R.id.list);

Full width Dialog

久未见 提交于 2019-12-12 04:16:31
问题 I what the Dialog to cover up the whole screen width. Hence: Dialog dialog = new Dialog(this); LayoutParams params = dialog.getWindow().getAttributes(); params.height = LayoutParams.MATCH_PARENT; params.width = LayoutParams.MATCH_PARENT; dialog.getWindow().setAttributes(params); But the result is: Skip is a button in a parent layout (MATCH_PARENT as width and height and 10dp padding and orange background). Even in this answer the final result has some gaps on sides. Is there a way to cover

Android Theme Issue using AlertDialog.Builder

亡梦爱人 提交于 2019-12-12 03:29:57
问题 I don't see the line in Edittext when using TextInputLayout on Android 4.4 version tabs. Everything is perfect on Nexus 5 which is running 6.0. Please take a look at the screenshot: Samsung TAB running 4.4 Nexus 5 running 6.0 Above is an XML and opening it throught a dialog. I am opening the above in dialog box something like this: AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainActivity.this, android.R.style.Theme_Material_Light_Dialog));

To set background of Custom Layout with an ImageView to Transparent

只谈情不闲聊 提交于 2019-12-12 02:13:48
问题 I am building a Custom dialog box using the Android Developer docs link , for this i made a layout file <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rotatelayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#80000000" > <ImageView android:id="@+id/dialogimage" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> and i am

Custom Dialog EditText returns null

隐身守侯 提交于 2019-12-12 01:39:30
问题 Many people have faced similar issues, and I think I have followed and fixed all the issues as mentioned in all those posts on stackoverflow. setContentView to my layout initializing the edittext with dialog.findViewById But I am still stuck at the nullpointer. What am I missing ? Layout name is serverchange.xml. Contents of serverchange.xml are <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"

ListView Item Click Open Custom Dialog with Another Custom Listview

自古美人都是妖i 提交于 2019-12-11 20:17:21
问题 Here I have created custom dialog which includes listview with single choice mode. when user selects one of the item in listview then it should be selected when dialog is opened next time and user must be able to select another item also. Butmy problem is dialog radiobutton are unchecked when dialog is reopened. I have reffered the http://blog.thisisfeifan.com/2011/10/2-lines-text-in-single-choice-listview.html So what is wrong in my code ? My custom Dialog xml file: <?xml version="1.0"

How to Implement DialogBox and onLongClick at the same time on the button?

那年仲夏 提交于 2019-12-11 20:12:04
问题 I am working onLongClickListner and DialogBox I wanted to add button , when i click on it open a dialogBox (It first ask do you want to select the button) after click on the DialogButton True it comes back to selected button then it hold button for a while to check the answer and If the answer is correct then it show Message "Answer is true" and wrong it show Message"Answer is False". Here Is my code :- public class QuestionActivity extends Activity implements OnClickListener{ private

onclick listener on button in dialog force closes app

依然范特西╮ 提交于 2019-12-11 19:35:02
问题 I have two buttons that show in a dialog pop up in my android app. My problem is one of my onclick listeners for one button works, while the other force closes. The error I get is: 06-28 22:32:51.494: E/AndroidRuntime(29309): FATAL EXCEPTION: main 06-28 22:32:51.494: E/AndroidRuntime(29309): java.lang.NullPointerException 06-28 22:32:51.494: E/AndroidRuntime(29309): at com.example.beerportfoliopro.TasteTags$2.onClick(TasteTags.java:83) 06-28 22:32:51.494: E/AndroidRuntime(29309): at android

Error on dismissing ProgressDialog in AsyncTask

孤街醉人 提交于 2019-12-11 18:27:15
问题 I have a completely separate class, which extends AsyncTask, I use it for executing a html get, so it wont freeze the UI. In the constructor of the AsyncTask Im passing the activity's context, which invokes the .execute() of the task, so I can show a ProgressDialog while the htmlget is running. Here came the first problem: when rotating the phone, the current view got destroyed, and when the app reached the .dismiss() of the dialog, it crashed, since the view it was attached to does not exist