android-alertdialog

Populating a ListView from SharedPreferences

女生的网名这么多〃 提交于 2019-12-23 04:28:45
问题 What I'm looking to do is populate a ListView from an AlertDialog entry. I've tried to do this with SharedPreferences, previously I've had the last entry just saving into the ListView (if I entered more than one String), so when I left the activity and returned all that appeared in the list was my last entry. However I figured that problem out and have modified the save procedure to change the "Key" field of the stored preference by incrementing an attached Int variable. To give you the full

Android Service and AlertDialog Activity

怎甘沉沦 提交于 2019-12-23 04:22:51
问题 I'm trying to build a service which runs in the background and pops up an alert dialog even when you are not in the application screen currently. I'm using an alarm manager. My problem is that when my alert dialog activity pops up - it shows the application activity as background. In other words, I don't want the alert dialog to change the current background and after the user is clicking "OK" it will be back to the same state, and not to my application. How can I do that ? 回答1: The easiest

Android AlertDialog constructor is undefined

不羁的心 提交于 2019-12-23 04:05:20
问题 I'm trying to have a alert dialog show if account info is missing when clicking the check the account. I get an error in Eclipse where new AlertDialog.Builder(this) saying the constructor AlertDialog.Builder(new View OnClickListener(){}) is undefined . The code works fine if I add it to the onCreate of the activity. checkButton.setOnClickListener(new OnClickListener() { public void onClick(View Arg0){ String AccNum = null, Store = null; final SharedPreferences settings = getSharedPreferences

How do I show permissions rationale for multiple permissions request?

做~自己de王妃 提交于 2019-12-23 03:25:09
问题 I am working with Android API 25 and need to make permissions requests in the app. There are a ton of code samples on how to make a request as well as how to show the rationale. This link here shows a simple methodology as do these: Android M Request Multiple permission at a single time , Android M request permission non activity The problem I am having is I am requesting multiple permissions at once (Location, Write storage access, and Contacts) and the ActivityCompatApi23

Alert Dialog Positive Button Issue

我怕爱的太早我们不能终老 提交于 2019-12-22 14:17:41
问题 I have alert dialog initiated on button click , it had username and password , after alert dialog fired , if you press OK button , it force close and close the app , any help will be appreciated. public class MainActivity extends Activity { final Context context = this; private Button button; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView tv=(TextView

Alert Dialog Positive Button Issue

北战南征 提交于 2019-12-22 14:17:18
问题 I have alert dialog initiated on button click , it had username and password , after alert dialog fired , if you press OK button , it force close and close the app , any help will be appreciated. public class MainActivity extends Activity { final Context context = this; private Button button; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView tv=(TextView

AlertDialog setmessage not working inside Asynctask

China☆狼群 提交于 2019-12-22 14:16:34
问题 Below is my code my trying to display my progress in Asyntask via onProgressUpdate method but it aint showing in the alert diaalog. Only the initial message is shown. class DownloadFileFromURL extends AsyncTask<String, String, String> { private AlertDialog.Builder alert; private int progress = 0; /** * Before starting background thread Show Progress Bar Dialog */ @Override protected void onPreExecute() { super.onPreExecute(); alert = new AlertDialog.Builder(context); alert.setTitle(

AlertDialog setmessage not working inside Asynctask

与世无争的帅哥 提交于 2019-12-22 14:16:07
问题 Below is my code my trying to display my progress in Asyntask via onProgressUpdate method but it aint showing in the alert diaalog. Only the initial message is shown. class DownloadFileFromURL extends AsyncTask<String, String, String> { private AlertDialog.Builder alert; private int progress = 0; /** * Before starting background thread Show Progress Bar Dialog */ @Override protected void onPreExecute() { super.onPreExecute(); alert = new AlertDialog.Builder(context); alert.setTitle(

Android views' borders issue on some devices

心已入冬 提交于 2019-12-22 12:38:15
问题 TOPIC Solved: Answer below. Some users have been reporting border alignment issues on some android components such as the alert popup or the editTexts. This is happening on the Samsung Galaxy Apollo (200x400) and the HTC Pro Touch (480x640) devices. I cannot replicate that because i don't own those devices and in the Samsung Galaxy S and emulator everything looks just right. I think that the problem is the dpi or resolution of the device (because the edittext background is a single .9.png so

Dynamically set custom AlertDialog content

时间秒杀一切 提交于 2019-12-22 08:16:27
问题 I have a custom dialog that I set up as a function: public void customDialog(Bitmap bm, String title){ TextView dialogtext = (TextView)findViewById(R.id.layout_root); //For above also tried r.id.popup which is the containing file for the layout ImageView dialogimage = (ImageView)findViewById(R.id.popupimage); dialogtext.setText(title); dialogimage.setImageBitmap(bm); LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.popup, (ViewGroup) findViewById(R.id