Connected component (graph theory)
Category: IT
InputFilter
{ final InputFilter filter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { for (int i = start; i < end; i++) { if (Character.isDigit(source.charAt(i))||Character.isLetter(source.charAt(i))) { return ""; } } return null; } }; answerTXT.setFilters(new InputFilter[]{filter});
ContextWrapper ContextImpl getBaseContext
ActivityThread casts Application.getBaseContext() to ContextImpl
static ContextImpl getImpl(Context context) { Context nextContext; while ((context instanceof ContextWrapper) && (nextContext=((ContextWrapper)context).getBaseContext()) != null) { context = nextContext; } return (ContextImpl)context; }
Potential crash when !(context instanceof Activity)
public static Activity unwrap(Context context) { while (!(context instanceof Activity)) { ContextWrapper wrapper = (ContextWrapper) context; context = wrapper.getBaseContext(); } return context; }
SHS to RTF
How to compile java. How to build jar
Why did I decide to write this post?
Because of these:
Could not find or load main class
or How to specify main class for console app.