This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final Handler mHandler = new Handler(); | |
// should be inside onItemClick of DrawerItemClickListener | |
mHandler.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
mFragManager.beginTransaction().replace(R.id.content_frame,mFragment).addToBackStack(null).commit(); | |
} | |
}, 300); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*1) Searching Array by converting Array to ArrayList in Java | |
ArrayList in Java has a convenient method called contains() which returns true if object passed to it are inside ArrayList. by converting an array into ArrayList in Java we can easily use this option for searching any element in Java array. | |
2) Search Java array by converting Array to HashSet | |
Just like we can leverage ArrayList's contains method we can also use HashSet contains() method which has O(1) response time for search. So if you need constant search time to find an element in array, consider converting your Array into HashSet in Java. see the code section for complete example of searching elements in Java array using HashSet's contains() method. | |
3) Searching Java Array using Arrays.binarySearch() | |
Binary Search is another faster way of searching elements in Java array but it requires array to be sorted while earlier examples of finding elements on Array can be used with both sorted and unsorted array. java.util.Arrays class provides both so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="config_app_name">AVélib</string> | |
<string name="config_authority">com.cyrilmottier.android.avelib.citybikes</string> | |
<string name="config_com.google.android.maps.v2.api_key">XXX</string> | |
</resources> |
NewerOlder