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
package com.instantag.instantags.utils; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.os.IBinder; | |
import android.support.annotation.NonNull; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.inputmethod.InputMethodManager; |
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
HttpClient httpclient = HttpClients.createDefault(); | |
HttpPost httpPost = new HttpPost("http://httpbin.org/post"); | |
List<NameValuePair> params = new ArrayList<>(2); | |
params.add(new BasicNameValuePair("param-1", "12345")); | |
params.add(new BasicNameValuePair("param-2", "Hello2!")); | |
params.add(new BasicNameValuePair("param-3", "Hello3!")); | |
params.add(new BasicNameValuePair("param-4", "Hello4!")); | |
httpPost.setEntity(new UrlEncodedFormEntity(params, "UTF-8")); | |
HttpResponse response = httpclient.execute(httpPost); | |
HttpEntity entity = response.getEntity(); |
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 java.util.concurrent.Executor; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; | |
import java.util.concurrent.ScheduledFuture; | |
import java.util.concurrent.TimeUnit; | |
public class DelayedScheduleTest { | |
private static final int TASKS_NUMBER = 100; | |
private ScheduledExecutorService executor; |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>gd.wa</groupId> | |
<artifactId>minimal-pom</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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
// A blacklist of absolute package path directories that will be excluded from the main dex list. ex: 'com/company/package/path' | |
// the package name can be partial, since class names encountered that start with any of the given package names will be discarded. | |
ext.packagesToDiscardFromMainDexFile = [] | |
def shouldDiscardClass(String className) { | |
packagesToDiscardFromMainDexFile.any { className.startsWith(it) } | |
} | |
def patchMainDexKeepList(Project proj, String variantName) { | |
Task collectTask = proj.tasks.findByName("collect${variantName.capitalize()}MultiDexComponents") |
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
/** | |
* Port from {@link https://github.com/ReactiveX/RxSwift} | |
*/ | |
RxTextView.textChanges(mSearchbar.getEditTextSearch()) | |
.subscribeOn(AndroidSchedulers.mainThread()) | |
//delay 500ms | |
//debounce and throttle will use different thread after | |
.throttleWithTimeout(300, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()) | |
.distinct() | |
.filter(new Func1() { |
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
11-26 13:41:08.941 D/GA-BLACK_WHITE_LIST: BlackWhiteListHandler.scanPackages | |
11-26 13:41:08.956 D/GA-BLACK_WHITE_LIST: SamsungBlackWhiteListAdapter.scanBlacklistedApps | |
11-26 13:41:09.026 D/GA-BLACK_WHITE_LIST: SamsungBlackWhiteListAdapter.disableApplication Disabled package = com.popularapp.fakecall - false | |
11-26 13:41:09.046 D/GA-BLACK_WHITE_LIST: SamsungBlackWhiteListAdapter.disableApplication Disabled package = com.popularapp.sevenmins - false | |
11-26 13:41:09.081 D/GA-BLACK_WHITE_LIST: BlackWhiteListHandler.onAppInfoReceived flipboard.boxer.app | |
11-26 13:41:09.081 D/GA-BLACK_WHITE_LIST: SamsungBlackWhiteListAdapter.handleNewPackageInfo flipboard.boxer.app | |
11-26 13:41:09.096 D/GA-BLACK_WHITE_LIST: BlackWhiteListHandler.onAppInfoReceived com.android.printspooler | |
11-26 13:41:09.096 D/GA-BLACK_WHITE_LIST: SamsungBlackWhiteListAdapter.handleNewPackageInfo com.android.printspooler | |
11-26 13:41:09.106 D/GA-BLACK_WHITE_LIST: BlackWhiteListHandler.onAppInfoReceived com.sec.android.app.minimode.res | |
11-26 13:41:09.106 |
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
AbstractCommandExecutor.execute | |
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference | |
at com.good.android.gdmdm.command.executor.commandhandlers.blackwhitelist.SamsungBlackWhiteListAdapter.scanBlacklistedApps(SamsungBlackWhiteListAdapter.java:122) | |
at com.good.android.gdmdm.command.executor.commandhandlers.blackwhitelist.BlackWhiteListHandler.onBlackWhiteListSettingReceived(BlackWhiteListHandler.java:139) | |
at com.good.android.gdmdm.command.executor.device.SetBlackWhiteListSettingPackagesExecutor.executeCommand(SetBlackWhiteListSettingPackagesExecutor.java:38) | |
at com.good.android.gdmdm.command.executor.AbstractCommandExecutor.execute(AbstractCommandExecutor.java:42) | |
at com.good.android.gdmdm.command.manager.CommandManager.processCommand(CommandManager.java:37 |
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
String jsonArray = "[\"A\",\"B\",\"C\",\"D\"]"; | |
Gson gson = new Gson(); | |
Type type = new TypeToken<ArrayList<String>>() {}.getType(); | |
ArrayList<String> arrayList = gson.fromJson(jsonArray, type); | |
System.out.println(arrayList); |
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 RxTest { | |
public static void main(String[] args) { | |
String str = "sty"; | |
getDoubledString(str).subscribe(new Subscriber<Integer>() { | |
@Override | |
public void onCompleted() { | |
System.out.println("on complete"); | |
} |
NewerOlder