Delete Canvas - Fill Canvas Android example
Fill the entire canvas with the specified color.
@Override
public void onDraw(Canvas canvas) {
canvas.drawColor(Color.GREEN);
}
396LW NO topic_id
AD
Další témata ....(Topics)
C:\documents\workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.ui.prefs
Try this:
- check names of drawables (file name must contain only abc...xyz 012...789 _ . in Resources folder ,
names have to start with lower case
MyImage.jpg == problem ,
names with space
my image.jpg == problem,
names with -
my-image.png == problem)
- check duplicate names with other extension ( my_image.jpg - my_image.png makes the problem)
- restart Android Studio
- if problem persist:
- check c:\Users\me\AndroidStudioProjects\myProject\myModule\build\intermediates\res\merged\debug\ drawable folder for corupted names or delete ALL drawable folders
- synk projekt, rebuild projekt
- if problem persist:
- restart Android Studio, wait for complete closure of the Android Studio!
- check names of drawables (file name must contain only abc...xyz 012...789 _ . in Resources folder ,
names have to start with lower case
MyImage.jpg == problem ,
names with space
my image.jpg == problem,
names with -
my-image.png == problem)
- check duplicate names with other extension ( my_image.jpg - my_image.png makes the problem)
- restart Android Studio
- if problem persist:
- check c:\Users\me\AndroidStudioProjects\myProject\myModule\build\intermediates\res\merged\debug\ drawable folder for corupted names or delete ALL drawable folders
- synk projekt, rebuild projekt
- if problem persist:
- restart Android Studio, wait for complete closure of the Android Studio!
Tutorial by pictures how evaluate a variable in Eclipse debugger window.
1.) Open Debug perspective in Eclipse and to start debugging a Activity.
2.) Open Display window from menu Window->Show view->Display
3.) Set breakpoint where you need to evaluate a variable.
4.) Debug the Activity to breakpoint.
5.) Into the Display window type code for evaluate your variable and execute code.
6.) Check if change of value a variable
1.) Open Debug perspective in Eclipse and to start debugging a Activity.
2.) Open Display window from menu Window->Show view->Display
3.) Set breakpoint where you need to evaluate a variable.
4.) Debug the Activity to breakpoint.
5.) Into the Display window type code for evaluate your variable and execute code.
6.) Check if change of value a variable
Map TreeMap key value pair, Map sort by key, Iterator for Map Java Android example.
MainClass.java
MainClass.java
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
public class MainClass {
public static void main(String[] arg) {
// english;germany dictionary
String[] arrayOfString = { "one;eine", "two;zwei", "three;drei", "four;vier" };
Map<String, String> map = new TreeMap<String, String>();
for(String s: arrayOfString){
String[] array = s.split(";");
String sKey ="", sValue="";
if(array.length > 1){
sKey = array[0]; sValue = array[1];
map.put(sKey, sValue);
}
}
List sortedByKeys=new ArrayList(map.keySet());
Collections.sort(sortedByKeys);
// iterate map
Set references = map.keySet();
Iterator it = references.iterator();
while (it.hasNext()) {
String key = (String) it.next();
String value = map.get(key);
System.out.println(key + " = " + value);
}
// or other example how iterate map
TreeSet<String> keys = new TreeSet<String>(map.keySet());
for (String key : keys) {
String value = map.get(key);
System.out.println(key + " = " + value);
}
// check if key exists
// if( map.containsKey("two")){
// System.out.print("two = " + map.get("two"));
// }
}
}
/*
four = vier
one = eine
three = drei
two = zwei
*/
Editace: 2013-12-09 13:04:00
Počet článků v kategorii: 396
Url:delete-canvas-fill-canvas-android-example