Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Eclipse - Workspace in use or cannot be created chose a different one


Open your workspace folder and subfolder .metadata:
C:\Users\workspace\.metadata\

Delete .lock file

397LW NO topic_id



Další témata ....(Topics)


88

Map TreeMap key value pair sort by value Java Android example | map-treemap-key-value-pair-sort-by-value-java-android-example


Map TreeMap sorted by value Java Android example.

MainClass.java


import java.util.Comparator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;

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);
			}
		}
		for (Entry<String, String> entry: mapSortedByValues(map)) {
		    System.out.println(entry.getKey() + " = " + entry.getValue());
		}
	}

	static <K, V extends Comparable<? super V>> SortedSet<Map.Entry<K, V>> mapSortedByValues(
			Map<K, V> map) {
		SortedSet<Map.Entry<K, V>> sortedSetOfEntries = new TreeSet<Map.Entry<K, V>>(
				new Comparator<Map.Entry<K, V>>() {
					@Override
					public int compare(Map.Entry<K, V> entry_1, Map.Entry<K, V> entry_2) {
						int res = entry_1.getValue().compareTo(entry_2.getValue());
						return res != 0 ? res : 1; 
						// return entry_1.getValue().compareTo(entry_2.getValue());							
					}
				});
		sortedSetOfEntries.addAll(map.entrySet());
		return sortedSetOfEntries;
	}
}
/*
three = drei
one = eine
four = vier
two = zwei
 */

45

Adding TableRow add row with a View TextView dynamically to TableLayout Android sample example | adding-tablerow-add-row-with-a-view-textview-dynamically-to-tablelayout-android-sample-example


Adding TableRow with a View TextView (EditText Button) programmically dynamically to TableLayout Android sample basic example.
MainClass.java

public class MainClass extends Activity {
   
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        TableLayout tl = (TableLayout)findViewById(R.id.tableLayout1);
        TableRow row = new TableRow(this);
        TextView tv = new TextView(this);
        tv.setText("This is text");

        tl.addView(row);
        row.addView(tv);

    }
}



main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TableLayout android:layout_width="fill_parent" 
    android:id="@+id/tableLayout1" android:layout_height="wrap_content">
</TableLayout>
</LinearLayout>

235

ACRA allows your Android application to send Crash Reports | acra-allows-your-android-application-to-send-crash-reports


ACRA allows your Android application to send Crash Reports to various destinations:

a Google Docs spreadsheet (default and original behavior)
an email
your own server-side HTTP POST script
any other possible destination by implementing your own report sender

ACRA wiki and download page of project library
44

No resource found that matches the given name Eclipse Android xml file | no-resource-found-that-matches-the-given-name-eclipse-android-xml-file


No resource found that matches the given name - error examples.
Exist resource file?
Is code written correctly?

// No resource found that matches the given name (at id with value @id/myButton).
 android:id="@id/myButton" // invalid id notation
 android:id="@+id/myButton" // correct


 // No resource found that matches the given name 
// (at icon with value @drawable/icons).
// exist file icons in res/drawable folder?
<application android:icon="@drawable/icons" 

//No resource found that matches the given name 
//(at theme with value @style/MyThem).
<activity android:name=".Main"
                  android:label="@string/app_name"
                  android:theme="@style/MyThem">

// Exist style MyThem  in styles.xml ?  No only MyTheme
<style name="MyTheme" parent="android:Theme">
        <item name="android:windowTitleSize">50px</item>
</style>



// exist file my_background in folder drawable ?
android:background="@drawable/my_background" // 

// no resource found that matches the given name(at "label" with value "@string/app_name")
// have you the string resource defined in res/values/strings.xml ?
<string name="app_name">"My App"</string>


346

Difference between "@+id/” and "@id/” in Android | difference-between-id-and-id-in-android


Difference between "@+id/” and "@id/” in Android
android:id="@+id/xxx" unique identifier of view
@id/ a reference to the unique identifier

 <TextView
        android:id="@+id/first_element_id"
        .........
 />
    <TextView
        android:id="@+id/second_element_id"
        android:layout_below="@id/first_element_id"
        ..........
 />



Editace: 2014-02-15 20:15:23
Počet článků v kategorii: 397
Url:eclipse-workspace-in-use-or-cannot-be-created-chose-a-different-one
Share
Share
Tweet