spinner

Android - memory leak or?

孤者浪人 提交于 2019-12-04 15:05:46
two days ago i noticed something. I have a spinner over a map activity. In the OnCreate() method of the activity i populate the spinner with data. After that i start the heap analyzer in DDMS i begin to open/close the spinner. I noticed the VM allocate memory when i open the spinner items, but when i close it, the VM do no free this memory. I've tried to start the GC, but the memory is still allocated. i did this 20 times one by one and the allocated memory increased from 3.5MB to 7MB. What is wrong? I found an issue in google groups, but they haven't answered yet. Spinner memory leak I

Creating a spinner for choosing country code

拜拜、爱过 提交于 2019-12-04 13:21:01
问题 I want to create a spinner for selecting a country and getting its country code. I already found this item list: <string-array name="countryCodes"> <item>93,AF</item> <item>355,AL</item> <item>213,DZ</item> <item>376,AD</item> <item>244,AO</item> <item>672,AQ</item> <item>54,AR</item> <item>374,AM</item> <item>297,AW</item> <item>61,AU</item> <item>43,AT</item> <item>994,AZ</item> <item>973,BH</item> <item>880,BD</item> <item>375,BY</item> <item>32,BE</item> <item>501,BZ</item> <item>229,BJ<

EditText Height Issue

◇◆丶佛笑我妖孽 提交于 2019-12-04 12:52:26
I am trying to set smaller height of EditText but still have not managed it. Here is my source: <EditText android:layout_width="150dp" android:layout_height="20dp" android:singleLine="true" android:textSize="10dp" /> This code cuts out text and a white rectangular shape appears around EditText control. I have also tried maxHeight/minHeight properties, but did not worked either. If anybody have solved this issue, please help. Or is this is the bug in the android? I can not even resize Spinner, same happens as with EditText. Thanks Irfan You are probably seeing bizarre orange rectangular shapes

Get previous value of QComboBox, which is in a QTableWidget, when the value is changed

不羁岁月 提交于 2019-12-04 12:43:52
问题 Say I have a QTableWidget and in each row there is a QComboBox and a QSpinBox . Consider that I store their values is a QMap<QString /*Combo box val*/,int /*spin box val*/> theMap; When comboBoxe s value or spin boxes value is being changed I want to update theMap . So I should know what was the former value of the combo box in order to replace with the new value of the comboBox and also take care of the value of the spin box. How can I do this? P.S. I have decided to create a slot that when

Populating A Spinner From Another Spinner Depending on Condition

一世执手 提交于 2019-12-04 12:11:22
What i need to do is if a certain item from spinner 1 is selected it needs to display a certain array in spinner 01 e.g if spinner one selected item is Red spinner 01 needs to display level_array as the drop down options for spinner 01 else display cparklevel. in essence i am trying to display how many levels each car park has. so spinner 1 containts car park names and spinner 01 contains levels Spinner spinner = (Spinner) findViewById(R.id.spinner1); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource( this, R.array.cparkColour_array, android.R.layout.simple_spinner_item);

How to add spinner/loader in yii2 php

孤街醉人 提交于 2019-12-04 11:45:52
I want to add a spinner/loader in one of my forms. The scenario is simple: When I hit the create button then it will show a spinner/loader. On hitting the create button a call to a web-service is made so the spinner/loader will show from call start to call end. Below is my controller: $m = MetersInventoryStore::findOne($_REQUEST['selected_meters']); $msn = $m->meter_serial; // current selected meter serial number is saved $date_time = str_replace(' ', 'T', date('Y-m-d H:i:s')); // current date time $api_url = 'http://xx.xxx.xxx.xxx:7000/api/meters/GetByMsn/' . $msn . '/' .$date_time; // my

spinner adding string array on item selection how can get item related value in android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 11:04:21
问题 i am developing one spinner this spinner i am string array spinner = (Spinner)this.findViewById(R.id.mlg); final CharSequence[] itemArray =getResources().getTextArray(R.array.RectBeam); final List<CharSequence> itemList =new ArrayList<CharSequence>(Arrays.asList(itemArray)); adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item,itemList); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); spinner

Android: Open Spinner from Button

时光怂恿深爱的人放手 提交于 2019-12-04 10:49:42
问题 In an Android application, is it possible to open the spinner popup from a button click instead of pressing the actual spinner? I have tried the following: Button btnChange = (Button)findViewById(R.id.btnChange); btnChange.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Spinner mySpinner = (Spinner) findViewById(R.id.sSpinner); mySpinner.showContextMenu(); } }); 回答1: Sorry for late answer - it's possible: ((Spinner) findViewById(R.id.mySpinner)).performClick();

Spinner with Key-Value Pair

我的梦境 提交于 2019-12-04 08:37:06
I am working on multi languages UI. My requirement is in spinner I want to show data in Hindi but when it will be selected it should return english show it can compare to further decision making. Just like tag with tag. My java code is something like this HashMap<String,String> options=new HashMap<String,String>(); String optionsEnglish [] = getResources().getStringArray(R.array.option_array); String optinsHindi[]= getResources().getStringArray(R.array.option_array_hindi); for(int i=0;i<optionsEnglish.length;i++) { options.put(optionsEnglish[i], optinsHindi[i]); } Spinner optionSpinner =

Text Size of a Spinner

那年仲夏 提交于 2019-12-04 07:03:08
How can I decrease the font size of my spinner? I have reduced the spinner size to 35 pix because of which my text gets cut in half. How do i do that? Also I dont want anything to be selected beforehand. Default text should be "select some value" . after some tests, there is an easier way than subclassing ArrayAdapter. Change the ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.planets_array,android.R.layout.simple_spinner_item);//this is from the tutorial, adapt with your line to this line : ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource