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"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="match_parent" | |
android:background="@drawable/my_nine_patch" | |
android:orientation="horizontal" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" |
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
package com.android.volley.toolbox; | |
import org.json.JSONArray; | |
import android.text.TextUtils; | |
import com.android.volley.Response.ErrorListener; | |
import com.android.volley.Response.Listener; | |
public class MyJsonArrayRequest extends JsonArrayRequest { |
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
public class MyAsyncTask extends AsyncTask { | |
WeakReference<MyActivityInterface> mCaller; | |
public MyAsyncTask(MyActivityInterface caller) { | |
mCaller = caller; | |
} | |
// here comes code | |
public void onPostExecute(Object result) { |
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
foo(View source){ | |
if(source == null) { | |
return; | |
} | |
View container = source.getParent(); | |
getColorAnimation(container, true); | |
} | |
static ValueAnimator getColorAnimation(final View view, boolean shouldReverse) | |
{ |
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 void configureSearchView(Menu menu) { | |
MenuItem searchItem = menu.findItem(R.id.action_search); | |
searchViewAction = (SearchView) MenuItemCompat.getActionView(searchItem); | |
searchViewAction.setOnQueryTextListener(this); | |
searchViewAction.setOnCloseListener(this); | |
searchViewAction.setSubmitButtonEnabled(false); | |
searchViewAction.setIconifiedByDefault(true); | |
EditText editText = (EditText) searchViewAction.findViewById(android.support.v7.appcompat.R.id.search_src_text); | |
editText.addTextChangedListener(new TextWatcher() { |
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
mScheduler = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { | |
@Override | |
public Thread newThread(Runnable r) { | |
Thread th = Executors.defaultThreadFactory().newThread(r); | |
th.setPriority(Process.THREAD_PRIORITY_BACKGROUND); | |
th.setName("presence_thread"); | |
return th; | |
} | |
}); |
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
<receiver | |
android:name="com.thepoosh.pooshmeister.InstallReferrerReceiver" | |
android:exported="true"> | |
<intent-filter> | |
<action android:name="com.android.vending.INSTALL_REFERRER" /> | |
</intent-filter> | |
</receiver> |
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
public void parseString(String str) { | |
if(TextUtils.isEmpty(str)) { | |
// nothing here | |
return; | |
} | |
String[] words = str.split(" "); | |
StringBuilder sentence = new StringBuilder(str.length()); | |
int l_integer; | |
double l_double; |
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 static UncaughtExceptionHandler exceptionHandler = new Thread.UncaughtExceptionHandler() { | |
@Override | |
public void uncaughtException(Thread thread, Throwable ex) { | |
StringWriter sw = new StringWriter(); | |
PrintWriter pw = new PrintWriter(sw); | |
ex.printStackTrace(pw); | |
ex.printStackTrace(); | |
Runnable onPostExecute = new Runnable() { | |
@Override |
OlderNewer