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
byte aByte = -112; //0b1001_0000 | |
byte bByte = (byte) (aByte >> 4); //would expect 0b1111_1001 (-7) | |
System.out.println(bByte); //-7 | |
byte cByte = (byte) (aByte >>> 4); //would expect 0b0000_1001 (9) | |
System.out.println(cByte); //-7 |
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 final class GsonObjectPersister<T> extends InFileObjectPersister<T> | |
{ | |
// ============================================================================================ | |
// FIELDS | |
// ============================================================================================ | |
private final Gson gson; | |
// ============================================================================================ | |
// CONSTRUCTOR |
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 MyWebView extends WebView | |
{ | |
public MyWebView(Context context) | |
{ | |
super(context); | |
} | |
public MyWebView(Context context, AttributeSet attrs) | |
{ | |
super(context, attrs); |
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
//inside a fragment. If in an Activity you could use findViewById(Window.ID_ANDROID_CONTENT); | |
getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() | |
{ | |
@Override | |
public void onGlobalLayout() | |
{ | |
//do something like measure a view etc | |
View content = getWindow().findViewById(Window.ID_ANDROID_CONTENT); | |
Log.d("DISPLAY", content.getWidth() + " x " + content.getHeight()); | |
NewerOlder