When there is no error in the code, but for some reason the project says there is an error and prevents you from running...
When you've torn your hair out trying to delete and re-import your project files to no avail...
When you've "cleaned" and "fixed project properties" so many times your index fingertip is bleeding...
Try looking at your project problems ( Window > Show View > Problems )
You might get something that looks like this:
Debug Certificate Expired...
If the above has happened to you, then I have a fix for you! You can probably solve this problem by deleting the debug certificate file. (Eclipse will then build a new one, and the error will go away.)
Win 7 OS: Go to ( Window > Preferences > Android > Build ) and find out where the debug.keystore file is located on your hard drive. Then using file explorer, find it and destroy it.
Thats it. Import your projects or whatever, do a clean and the error should disappear.
References:
http://stackoverflow.com/questions/2194808/debug-certificate-expired-error-in-eclipse-android-plugins
Thursday, June 23, 2011
Wednesday, June 8, 2011
So you need to change the text size of simple_list_item_single_choice...
I feel you.
I tried for a month straight to call the checkedtextview in the android standard layout and resize the text. It never let me. I felt like a idiot. And now that I've figured it out, I know that it is more than just a feeling.
And so I'm posting it here, in the event that I actually forget how to do this later on. Because.. you know... I'm an idiot.
I went and copied the xml from the api demo and pasted it into a new .xml file(step 1). I accessed the text size and adjusted it thusly (step 2). Then I changed the java code to replace the simple_list_item_single_choice with my own custom row layout (step 3). Facepalmed for about two hours (step 4).
my_listitem_singlechoice.xml (i just chaged "textAppearance" attribute but I'm sure you can do other stuff to it too) :
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceSmall"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:paddingLeft="6dip"
android:paddingRight="6dip"
/>
my_java_with_singlechoice.java (this should look somewhat familiar) :
ListView lv = this.getListView();
MyListAdapter = new ArrayAdapter<String>(this, R.layout.my_listitem_singlechoice, myArrayList);
lv.setAdapter(MyListAdapter );
lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
I tried for a month straight to call the checkedtextview in the android standard layout and resize the text. It never let me. I felt like a idiot. And now that I've figured it out, I know that it is more than just a feeling.
And so I'm posting it here, in the event that I actually forget how to do this later on. Because.. you know... I'm an idiot.
I went and copied the xml from the api demo and pasted it into a new .xml file(step 1). I accessed the text size and adjusted it thusly (step 2). Then I changed the java code to replace the simple_list_item_single_choice with my own custom row layout (step 3). Facepalmed for about two hours (step 4).
my_listitem_singlechoice.xml (i just chaged "textAppearance" attribute but I'm sure you can do other stuff to it too) :
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceSmall"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:paddingLeft="6dip"
android:paddingRight="6dip"
/>
my_java_with_singlechoice.java (this should look somewhat familiar) :
ListView lv = this.getListView();
MyListAdapter = new ArrayAdapter<String>(this, R.layout.my_listitem_singlechoice, myArrayList);
lv.setAdapter(MyListAdapter );
lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
Subscribe to:
Posts (Atom)