- Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
- Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
- A fairly complete shortcut list can be found here.
This file contains hidden or 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
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.graphics.Canvas; | |
| import android.graphics.drawable.Drawable; | |
| import android.util.AttributeSet; | |
| import android.widget.ImageView; | |
| public class ForegroundImageView extends ImageView { | |
| private Drawable foreground; |
This file contains hidden or 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 rx.android.observables; | |
| import rx.Observable; | |
| import rx.Observable.OnSubscribe; | |
| import rx.Subscriber; | |
| import rx.android.subscriptions.AndroidSubscriptions; | |
| import rx.functions.Action0; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; |
This file contains hidden or 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
| /** | |
| * Execute an {@link AsyncTask} on a thread pool. | |
| * | |
| * @param task Task to execute. | |
| * @param args Optional arguments to pass to {@link AsyncTask#execute(Object[])}. | |
| * @param <T> Task argument type. | |
| */ | |
| public static <T> void execute(AsyncTask<T, ?, ?> task, T... args) { | |
| if (Build.VERSION.SDK_INT < Build.VERSION_CODES.DONUT) { | |
| throw new UnsupportedOperationException("This class can only be used on API 4 and newer."); |
NewerOlder