Weirdness | Solution |
---|---|
No debuggable applications | Untick then tick again Tools > Android > Enable ADB integration . If that does not work, disable USB debugging on device then re-enable. |
Can't put breakpoint in a place where it is normally allowed | Unplug device then plug it back in |
Stuck in "Scanning files to index" when deploying | Unplug device then plug it back in |
Everything suddenly becomes really really slow. Really slow, even autocomplete. | Check for updates! Pending updates usually cause this. |
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
# Git branch in prompt. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " |
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 static void hideSoftKeyboard(Context context, View view) { | |
InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); | |
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); | |
} |
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
youtube-dl -i https://www.youtube.com/watch?v=w45y_w4skKs | |
youtube-dl -i https://www.youtube.com/watch?v=LqBlYJTfLP4 | |
youtube-dl -i https://www.youtube.com/watch?v=WJY2tGVQDGQ | |
youtube-dl -i https://www.youtube.com/watch?v=r_LpCi6DQME | |
youtube-dl -i https://www.youtube.com/watch?v=70WqJxymPr8 | |
youtube-dl -i https://www.youtube.com/watch?v=B08iLAtS3AQ | |
youtube-dl -i https://www.youtube.com/watch?v=k3IT-IJ0J98 | |
youtube-dl -i https://www.youtube.com/watch?v=sO9aX87hq9c | |
youtube-dl -i https://www.youtube.com/watch?v=fFF2Yup2dMM | |
youtube-dl -i https://www.youtube.com/watch?v=MnvUlGFb3GQ |
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
#!/bin/bash | |
for i in "$@" | |
do | |
case $i in | |
-f=*|--file=*) | |
FILENAME="${i#*=}" | |
;; | |
-o=*|--out=*) | |
OUTPUT="${i#*=}" |
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
import android.databinding.BindingAdapter; | |
import android.databinding.InverseBindingAdapter; | |
import android.databinding.InverseBindingListener; | |
import android.databinding.InverseBindingMethod; | |
import android.databinding.InverseBindingMethods; | |
import android.databinding.adapters.ListenerUtil; | |
import android.support.v4.view.ViewPager; | |
import com.zdominguez.sdksandbox.R; |
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
@BindView(R.id.checkbox) CheckBox mCheckbox; | |
@BindView(R.id.container) ViewGroup mContainer; | |
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_constraint); | |
ButterKnife.bind(this); | |
mCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { | |
@Override |
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 override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
DataBindingUtil.setContentView<ActivityConstraintBinding>(this, R.layout.activity_constraint) | |
} |
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
fun resetPreferences() { | |
val dataDir = File("${filesDir.parent}/shared_prefs") | |
// Get the prefs files we are concerned with | |
val sharedPrefsFiles = dataDir.listFiles().filter { file -> | |
file.name.startsWith(BuildConfig.APPLICATION_ID) | |
} | |
// Get the nice displayable name | |
val sharedPrefsFileNames = sharedPrefsFiles.map { |
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
<shortcut …> | |
<intent | |
android:action="android.intent.action.VIEW" | |
android:targetPackage="com.zdominguez.sdksandbox" | |
android:targetClass="com.zdominguez.sdksandbox.MainActivity"> | |
<extra android:name="target_tab" android:value="settings" /> | |
</intent> | |
<intent | |
android:action="android.intent.action.VIEW" | |
android:targetPackage="com.zdominguez.sdksandbox" |
OlderNewer