I did something in the terminal and now I'm in an app or state I don't know how to get out of. Here's a cheat sheet to get you out of whatever mess you're in without jumping out a window.
Save and exit (Technically save-buffers-kill-terminal)
| import android.util.Log; | |
| import com.squareup.leakcanary.AnalysisResult; | |
| import com.squareup.leakcanary.DisplayLeakService; | |
| import com.squareup.leakcanary.HeapDump; | |
| import retrofit.RestAdapter; | |
| import retrofit.RetrofitError; | |
| import retrofit.http.Multipart; | |
| import retrofit.http.POST; | |
| import retrofit.http.Part; | |
| import retrofit.mime.TypedFile; |
| package main | |
| import "fmt" | |
| func main() { | |
| fmt.Println("Hello, 世界") | |
| } |
| %%% | |
| VERSION:1 | |
| LANGUAGE:ENGLISH | |
| %%% | |
| MODULE PPAMAIN | |
| !*********************************************************** | |
| ! | |
| ! File: PMppa340.prg | |
| ! |
I did something in the terminal and now I'm in an app or state I don't know how to get out of. Here's a cheat sheet to get you out of whatever mess you're in without jumping out a window.
Save and exit (Technically save-buffers-kill-terminal)
| /** | |
| * Load a contact photo thumbnail and return it as a Bitmap, | |
| * resizing the image to the provided image dimensions as needed. | |
| * @param photoData photo ID Prior to Honeycomb, the contact's _ID value. | |
| * For Honeycomb and later, the value of PHOTO_THUMBNAIL_URI. | |
| * @return A thumbnail Bitmap, sized to the provided width and height. | |
| * Returns null if the thumbnail is not found. | |
| */ | |
| private Bitmap loadContactPhotoThumbnail(String photoData) { | |
| // Creates an asset file descriptor for the thumbnail file. |
| retrolambda { | |
| // OS X comes with a tool to get the home directory for a given version | |
| // of Java so let's just use that rather than mess about with properties | |
| // or environment variables. | |
| oldJdk "/usr/libexec/java_home -v1.7".execute().text.trim() | |
| } |
| public class MyApplication extends Application { | |
| public void onCreate() { | |
| super.onCreate(); | |
| Stetho.initialize( | |
| Stetho.newInitializerBuilder(this) | |
| .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) | |
| .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this)) | |
| .build()); | |
| } |
| //buildscript { | |
| // dependencies { | |
| // classpath 'me.tatarka:gradle-retrolambda:+' // Lambda support on android | |
| // } | |
| //} | |
| //apply plugin: 'retrolambda' | |
| android { | |
| //compileOptions { | |
| // sourceCompatibility JavaVersion.VERSION_1_8 |
| public class WhateverActivity extends ActionBarActivity { | |
| public void onCreate(Bundle savedInstanceState) { | |
| super(savedInstanceState); | |
| setContentView(R.layout.whatever); | |
| Toolbar toolbar = findViewById(R.id.toolbar); | |
| setSupportActionBar(toolbar); | |
| } |
| If you get a lot of linking errors like this: | |
| /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a | |
| you probably need to | |
| sudo apt-get install g++-multilib |