Skip to content

Instantly share code, notes, and snippets.

@yrulee
yrulee / CallEndTextMessagingActivity.java
Created November 23, 2016 07:43
Usage of error handling.
}, new NetworkRxHelper.OnAfterConnectInBackground() {
@Override
public void call(ApiCall.ApiResponse response) {
try {
throw new IOException("Test Exception");
} catch (IOException e) {
rxHelper.setThrowable(e);
}
}
}
@yrulee
yrulee / CallEndTextMessagingActivity.java
Created November 23, 2016 07:41
Usage of NetworkRxHelper
//import static gogolook.callgogolook2.util.NetworkRxHelper.*;
NetworkRxHelper rxHelper = create(mContext);
rxHelper.connect(
new OnGetApiCall() {
@Override
public ApiCall call() {
return null;//return ApiCall object
}
@yrulee
yrulee / CallEndTextMessagingActivity.java
Created November 23, 2016 07:21
Usage of NetworkRxHelper.
//import static gogolook.callgogolook2.util.NetworkRxHelper.*;
NetworkRxHelper rxHelper = create(mContext);
rxHelper.connect(
new OnGetApiCall() {
@Override
public ApiCall call() {
return null;//return ApiCall object
}
@yrulee
yrulee / CallEndTextMessagingActivity.java
Created November 23, 2016 07:16
Usage of exception handling.
}, new OnAfterConnectInBackground() {
@Override
public void call(ApiCall.ApiResponse response) {
try {
throw new Exception("This is a test exception");
} catch (Exception e) {
rxHelper.setThrowable(e);
}
}
}
@yrulee
yrulee / CallEndTextMessagingActivity.java
Created November 23, 2016 07:15
Usage of exception handling.
}, new OnAfterConnectInBackground() {
@Override
public void call(ApiCall.ApiResponse response) {
try {
throw new Exception("This is a test exception");
} catch (Exception e) {
rxHelper.setThrowable(e);
}
}
}
@yrulee
yrulee / CallEndTextMessagingActivity.java
Created November 23, 2016 07:14
Usage of exception handling.
new OnAfterConnectInBackground() {
@Override
public void call(ApiCall.ApiResponse response) {
try {
throw new Exception("This is a test exception");
} catch (Exception e) {
rxHelper.setThrowable(e);
}
}
}
@yrulee
yrulee / CallEndTextMessagingActivity.java
Created November 23, 2016 07:11
Usage of NetworkRxHelper.
NetworkRxHelper rxHelper = create(mContext);
rxHelper.connect(
new OnGetApiCall() {
@Override
public ApiCall call() {
return null;//return ApiCall object
}
}, new OnBeforeConnect() {
@Override
@yrulee
yrulee / RxHelperTest.java
Created November 23, 2016 06:47
Usage of runAsRxHelper.
CancellableNetworkProgressAsyncTask task = new CancellableNetworkProgressAsyncTask(mContext) {
... ... ...
};
//Utils.executeAsyncTaskBackground(task);
task.runAsRxHelper();
Intent dialogIntent = new Intent(this, ExampleDialogActivity.class);
dialogIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialogIntent);
Intent dialogIntent = new Intent(this, ExampleDialogActivity.class);
dialogIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialogIntent);