how do i share my comments to fb using socialize - android

how do I share my comments to facebook using socialize, I tried the following codes but it directly enters into the facebook home page its not sharing my comments...can anyone help me
here is my code,
public class TraSocializeActivity extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String entityKey = "http://www.getsocialize.com";
Entity entity = Entity.newInstance(entityKey, "Socialize");
View actionBarWrapped = Socialize.getSocializeUI().showActionBar(this, R.layout.main, entity);
setContentView(actionBarWrapped);
//this is the code for sharing my comments to facebook but its not working it allows the //user to enter the facebook directly
if(Socialize.getSocialize().isAuthenticated()) {
//Entity entity1 = Entity.newInstance("http://someurl.com", "My Entity");
String comment = "The comment to be added";
ShareOptions options = new ShareOptions();
options.setShareLocation(true);
options.setShareTo(SocialNetwork.FACEBOOK);
options.setListener(new SocialNetworkListener()
{
public void onError(Activity activity, SocialNetwork network, String message, Throwable e)
{
}
public void onBeforePost(Activity activity, SocialNetwork network)
{
}
{ // Handle before post
}
public void onAfterPost(Activity activity, SocialNetwork network)
{ // Handle after post
}
});
Socialize.getSocialize().addComment(this, entity, comment, options, new CommentAddListener()
{
public void onError(SocializeException error) {
// Handle error
}
public void onCreate(Comment comment)
{ // Handle success
}
});
}
}
}

I'll ping our devs to get you an answer tonight. Sorry for the delay; just saw your question. - DROdio

Related

Android ReCaptcha: Checkboxes are not shown

I use Android SafetyNet ReCaptcha to show the Google captcha in my Android app. The problem is that when I test it, the checkboxes are never shown. Instead, the captcha is well shown, and its progress bar is animated a little, and then it finishes without any error, confirming I'm a human. This behavior is normal and there isn't any bug.
But. I would want to force the captcha, which seems to work well as I've described above, to show the checkboxes. By "checkboxes", I mean e.g. "checkboxes showing pedestrian crossings that the human user must claim to recognize by checking". The official documentation doesn't explain how to do it: https://developer.android.com/training/safetynet/recaptcha#send-request
Resources (documentation and StackOverflow)
Documentation : 1 link but unrelevant
I've followed this documentation: https://developer.android.com/training/safetynet/recaptcha#send-request . However, it doesn't give any information about how to solve my problem.
StackOverflow : 1 question but unrelevant
I haven't found any relevant question. I've not found, in fact, any question on how to implement ReCaptcha for Android, except a very short one (which doesn't provide any useful data to solve my problem).
My implementation
I'm going to show you how I've implemented their API ReCaptcha for Android (SafetyNet ReCaptcha) to help you to help me.
The process
My app's users can sign-up, sign-in, sign-out.
When a user starts my app, a splash screen appears. If the user isn't connected, he is invited to touch a button.
2.1. If he touches the button, the ReCaptcha is started.
2.1.1. If the ReCaptcha is successfully completed, then the user can sign-up and sign-in with his Google account (I use Google Firebase Auth and even AuthUI).
2.1.2. Otherwise, nothing occurs : he'll have to re-try to complete ReCaptcha.
Sources
SplashScreen.java (an AppCompatActivity class): The "onClick" event handler listening to the "touch" event on the button
In résumé: I attach the listener to the button. If the latter is clicked, thus, I call verifyWithRecaptcha in a (synchrone! and it's voluntary) Executor. Then I call the Google's servers to be sure the captcha has been completed by a humain being, not by a bot, thanks to my class NetworkUseRecaptcha which provides the result of the Google's servers.
final Context that = this;
button_splash_screen_recaptcha.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
final Executor executor = new Executor() {
#Override
public void execute(#NonNull Runnable command) {
command.run();
}
};
executor.execute(new Runnable() {
#Override
public void run() {
SafetyNet.getClient(that).verifyWithRecaptcha("PUBLIC KEY")
.addOnSuccessListener(executor,
new OnSuccessListener<SafetyNetApi.RecaptchaTokenResponse>() {
#Override
public void onSuccess(final SafetyNetApi.RecaptchaTokenResponse response) {
String userResponseToken = response.getTokenResult();
if (!userResponseToken.isEmpty()) {
String[] parameters = new String[2];
parameters[0] = "SECRET KEY";
parameters[1] = userResponseToken;
new NetworkUseRecaptcha(new RecaptchaPostExecuteCallback() {
#Override
public void onTaskCompleted(String result, boolean background_error) {
if(background_error) {
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(that,"Error N°2: Unable to check the captcha.", Toast.LENGTH_SHORT).show();
}
});
return;
}
try {
final JSONObject json_response = new JSONObject(result);
if(!json_response.isNull("success") && json_response.getBoolean("success")) {
final List<AuthUI.IdpConfig> providers = ImmutableList.of(
new AuthUI.IdpConfig.GoogleBuilder().build()
);
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.setAlwaysShowSignInMethodScreen(true)
.setLogo(R.drawable.yellow_logo)
.setTheme(R.style.LoginTheme)
.build(),
REQUEST_CODE_SIGN_IN
);
} else {
Toast.makeText(that,"Error N°4: Unable to check the captcha.", Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(that,"Error N°3: Unable to check the captcha.", Toast.LENGTH_SHORT).show();
}
});
}
}
}).execute(parameters);
}
}
})
.addOnFailureListener(executor, new OnFailureListener() {
#Override
public void onFailure(#NonNull Exception e) {
System.err.println(e);
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(that,"Error N°1: Unable to check the captcha.", Toast.LENGTH_SHORT).show();
}
});
}
});
}
});
}
});
NetworkUseRecaptcha.java: My class that allows me to contact the Google's servers to verify the captcha
class NetworkUseRecaptcha extends AsyncTask<String, Void, String> {
private final RecaptchaPostExecuteCallback post_execute_callback;
private boolean background_error;
NetworkUseRecaptcha(RecaptchaPostExecuteCallback post_execute_callback) {
this.post_execute_callback = post_execute_callback;
background_error = false;
}
#Override
protected String doInBackground(String[] parameters) {
StringBuilder string_builder = new StringBuilder();
try {
URL url = new URL("https://www.google.com/recaptcha/api/siteverify");
HttpsURLConnection https_url_connection = (HttpsURLConnection) url.openConnection();
https_url_connection.setRequestMethod("POST");
https_url_connection.setDoOutput(false);
https_url_connection.setUseCaches(false);
OutputStream os = https_url_connection.getOutputStream();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8));
writer.write("secret=" + parameters[0] + "&response=" + parameters[1]);
writer.flush();
writer.close();
os.close();
InputStream input_stream = https_url_connection.getInputStream();
BufferedReader buffered_reader = new BufferedReader(new InputStreamReader(input_stream));
String line;
while((line = buffered_reader.readLine()) != null) {
string_builder.append(line);
}
buffered_reader.close();
} catch (Exception e) {
background_error = true;
}
return string_builder.toString();
}
#Override
protected void onPostExecute(String result) {
post_execute_callback.onTaskCompleted(result, background_error);
}
}
https://developers.google.com/android/reference/com/google/android/gms/safetynet/SafetyNetClient#verifyWithRecaptcha(java.lang.String): "If reCAPTCHA is confident that this is a real user on a real device it will return a token with no challenge. Otherwise it will provide a visual/audio challenge to attest the humanness of the user before returning a token."
So my wish is impossible to concretize...

What's a good way to asynchronously update the progress of ProgressDialog from background thread?

I want to have a Splash screen that has an inderteminate ProgressDialog and its progress gets updated by async calls from within a Presenter class (from MVP architecture).
I have a number of API calls to make to my BaaS server and for every successfull call, I would like to update the progress bar.
What's the best way to accomplish this?
I have been trying using EventBus to send notifications to my SplashActivity but it seems that all the API calls are first completed and only then the bus notifications are getting consumed and updating the UI.
What I have done so far is:
SplashActivity:
#Subscribe(threadMode = ThreadMode.MAIN)
public void onProgressBar(String event) {
Timber.d("onProgressBar");
if(event.contains("Done")) {
roundCornerProgressBar.setProgress(100);
} else {
roundCornerProgressBar.setProgress(roundCornerProgressBar.getProgress() + 10);
}
textViewTips.setText(event);
}
Presenter:
InstanceID iid = InstanceID.getInstance(ctx);
String id = iid.getId();
mDataManager.getPreferencesHelper().putInstanceId(id);
GSUtil.instance().deviceAuthentication(id, "android", mDataManager);
GSUtil.instance().getPropertySetRequest("PRTSET", mDataManager);
GSUtil:
public void deviceAuthentication(String deviceId, String deviceOS, final DataManager mDataManager) {
gs.getRequestBuilder().createDeviceAuthenticationRequest()
.setDeviceId(deviceId)
.setDeviceOS(deviceOS)
.send(new GSEventConsumer<GSResponseBuilder.AuthenticationResponse>() {
#Override
public void onEvent(GSResponseBuilder.AuthenticationResponse authenticationResponse) {
if(mDataManager != null) {
mDataManager.getPreferencesHelper().putGameSparksUserId(authenticationResponse.getUserId());
}
EventBus.getDefault().post("Reading player data");
}
});
}
public void getPropertySetRequest(String propertySetShortCode, final DataManager mDataManager) {
gs.getRequestBuilder().createGetPropertySetRequest()
.setPropertySetShortCode(propertySetShortCode)
.send(new GSEventConsumer<GSResponseBuilder.GetPropertySetResponse>() {
#Override
public void onEvent(GSResponseBuilder.GetPropertySetResponse getPropertySetResponse) {
GSData propertySet = getPropertySetResponse.getPropertySet();
GSData scriptData = getPropertySetResponse.getScriptData();
try {
JSONObject jObject = new JSONObject(propertySet.getAttribute("max_tickets").toString());
mDataManager.getPreferencesHelper().putGameDataMaxTickets(jObject.getInt("max_tickets"));
jObject = new JSONObject(propertySet.getAttribute("tickets_refresh_time").toString());
mDataManager.getPreferencesHelper().putGameDataTicketsRefreshTime(jObject.getLong("refresh_time"));
} catch (JSONException e) {
e.printStackTrace();
}
EventBus.getDefault().post("Game data ready");
EventBus.getDefault().post("Done!");
}
});
}
Right now I am just showing you 2 API calls, but I will need another 2.
Thank you
I found the answer! It's easier that I thought, which is unfortunate as I spend about 4 hours on this:
First, I created two new methods on my MVPView interface:
public interface SplashMvpView extends MvpView {
void updateProgressBarWithTips(float prog, String tip);
void gameDataLoaded();
}
Then, in the presenter itself, I call every API call and for every call, I update the View with the updateProgressBarWithTips method and when everything is completed, I finalise it so I can move from Splash screen to Main screen:
private void doGSData(String id) {
getMvpView().updateProgressBarWithTips(10, "Synced player data");
GSAndroidPlatform.gs().getRequestBuilder().createDeviceAuthenticationRequest()
.setDeviceId(id)
.setDeviceOS("android")
.send(new GSEventConsumer<GSResponseBuilder.AuthenticationResponse>() {
#Override
public void onEvent(GSResponseBuilder.AuthenticationResponse authenticationResponse) {
if(mDataManager != null) {
mDataManager.getPreferencesHelper().putGameSparksUserId(authenticationResponse.getUserId());
}
getMvpView().updateProgressBarWithTips(10, "Synced game data");
GSAndroidPlatform.gs().getRequestBuilder().createGetPropertySetRequest()
.setPropertySetShortCode("PRTSET")
.send(new GSEventConsumer<GSResponseBuilder.GetPropertySetResponse>() {
#Override
public void onEvent(GSResponseBuilder.GetPropertySetResponse getPropertySetResponse) {
GSData propertySet = getPropertySetResponse.getPropertySet();
GSData scriptData = getPropertySetResponse.getScriptData();
try {
JSONObject jObject = new JSONObject(propertySet.getAttribute("max_tickets").toString());
mDataManager.getPreferencesHelper().putGameDataMaxTickets(jObject.getInt("max_tickets"));
jObject = new JSONObject(propertySet.getAttribute("tickets_refresh_time").toString());
mDataManager.getPreferencesHelper().putGameDataTicketsRefreshTime(jObject.getLong("refresh_time"));
} catch (JSONException e) {
e.printStackTrace();
}
getMvpView().gameDataLoaded();
}
});
}
});
}
I hope this helps someone, if you're using MVP architecture.
Cheers

Null pointer exception in creating a dialog in quickblox [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I having some issue in creating a dialog of type group in quickblox chat service on android. I am able to get all the user from the server side of quickblox, able to build dialog and adding those users i got in it but when it comes to call groupChatManager.createDialog(dialog, new QBEntityCallbackImpl(). I am getting a null pointer exception on that. I found later that i have to initialise chatService in class that extends application i did that but still same error. here is my code
enter code here
My applicationSingeltonClass
public class ApplicationSingleton extends Application
{
private QBUser currentUser;
//quickBlox
private static final String APP_ID = "key";
private static final String AUTH_KEY = "authkey";
private static final String AUTH_SECRET = "authsec";
private static ApplicationSingleton instance;
private Map<Integer, QBUser> dialogsUsers = new HashMap<Integer, QBUser>();
private QBRoomChat currentRoom;
#Override
public void onCreate()
{
super.onCreate();
initApplication();
initImageLoader(getApplicationContext());
}
public static ApplicationSingleton getInstance()
{
return instance;
}
private void initImageLoader(Context context)
{
// This configuration tuning is custom. You can tune every option, you may tune some of them,
// or you can create default configuration by
// ImageLoaderConfiguration.createDefault(this);
// method.
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
.threadPriority(Thread.NORM_PRIORITY - 2)
.denyCacheImageMultipleSizesInMemory()
.discCacheFileNameGenerator(new Md5FileNameGenerator())
.tasksProcessingOrder(QueueProcessingType.LIFO)
.enableLogging() // Not necessary in common
.build();
// Initialize ImageLoader with configuration.
ImageLoader.getInstance().init(config);
}
public QBUser getCurrentUser()
{
return currentUser;
}
public void setCurrentUser(QBUser currentUser)
{
this.currentUser = currentUser;
}
public Map<Integer, QBUser> getDialogsUsers()
{
return dialogsUsers;
}
public void setDialogsUsers(List<QBUser> setUsers)
{
dialogsUsers.clear();
for (QBUser user : setUsers)
{
dialogsUsers.put(user.getId(), user);
}
}
public void addDialogsUsers(List<QBUser> newUsers)
{
for (QBUser user : newUsers)
{
dialogsUsers.put(user.getId(), user);
}
}
public Integer getOpponentIDForPrivateDialog(QBDialog dialog)
{
Integer opponentID = -1;
for(Integer userID : dialog.getOccupants())
{
if(userID != getCurrentUser().getId())
{
opponentID = userID;
break;
}
}
return opponentID;
}
private void initApplication()
{
instance = this;
QBChatService.setDebugEnabled(true);
QBSettings.getInstance().fastConfigInit(APP_ID, AUTH_KEY,AUTH_SECRET);
}
}
here is my other class were i create a dialog
enter code here
protected void onPostExecute(final Boolean success)
{
if(status.equals("accepted"))
{
pagedRequestBuilder.setPage(1);
pagedRequestBuilder.setPerPage(10);
final ArrayList<String> usersLogins = new ArrayList<String>();
usersLogins.add(userID);
usersLogins.add(herocivID);
final ArrayList<Integer> occupantIdsList = new ArrayList<Integer>();
occupantIdsList.add(civID);
occupantIdsList.add(heroCivID);
QBUsers.getUsersByFacebookId(usersLogins, pagedRequestBuilder, new QBEntityCallbackImpl<ArrayList<QBUser>>() {
#Override
public void onSuccess(ArrayList<QBUser> users, Bundle params)
{
if (!QBChatService.isInitialized())
{
QBChatService.init(getApplicationContext());
chatService = QBChatService.getInstance();
chatService.addConnectionListener(chatConnectionListener);
}
QBDialog dialog = new QBDialog();
dialog.setName("chat with mostafa wo may");
dialog.setType(QBDialogType.GROUP);
dialog.setOccupantsIds(occupantIdsList);
QBGroupChatManager groupChatManager = chatService.getInstance().getGroupChatManager();
groupChatManager.createDialog(dialog, new QBEntityCallbackImpl<QBDialog>()
{
#Override
public void onSuccess(QBDialog dialog, Bundle args)
{
Log.i("", "dialog: " + dialog);
}
#Override
public void onError(List<String> errors) {
Toast.makeText(getBaseContext(), "Something went wrong", Toast.LENGTH_SHORT).show();
}
});
}
#Override
public void onError(List<String> errors)
{
Toast.makeText(getBaseContext(), "Something went wrong", Toast.LENGTH_SHORT).show();
}
});
Toast.makeText(getBaseContext(), "you accepted the request", Toast.LENGTH_SHORT).show();
}
else if(status.equals("rejected"))
{
Toast.makeText(getBaseContext(), "you rejected the request", Toast.LENGTH_SHORT).show();
}
}
i need to know were exactly i have to configure the chat service to prevent the null pointer while creating a dialog.
Any help would be appreciated thank you.
You're right,
chatService.getInstance().getGroupChatManager();
is null if you're not logged in ti Chat
so you have to login to chat first and then call this method
I managed to solve this issue.
First you need to check roomChatManager if its equal to null you have to ask the user to login in.
Second in the login wether your using social provider or by mail you have to login to chatService ( ApplicationSingleton.getInstance().chatService.login(userResult);)
ApplicationSingleton is a java class were it extends Application in it you initialise the ChatService.
Thats it now you can create your dialog successfully.

Facebook Login doesn't work when I use Samsung Android 4.2

When I use HTC Android, it do very well. However, when I use API of Facebook to login using Samsung Android 4.2, I show an Toast message like "login fail please contact the marker of this app and ask them to issue 1732910 to facebook"
Please help me to fix it!
public class FacebookLogin {
/* variable Facebook */
private static final String FACEBOOK_APPID = "578073962236765";
private FacebookConnector facebookConnector;
private final Handler mFacebookHandler = new Handler();
ActivityBase activity;
Request.GraphUserCallback userCallback;
LoginService.OnSwimLogedInEvents swimLoginCallBack;
LoginService loginService;
Dialog changeDialog;
LoadingDialog loadingDialog;
public FacebookLogin(ActivityBase activity, Request.GraphUserCallback userCallback, LoginService.OnSwimLogedInEvents swimLoginCallBack) {
this.activity = activity;
this.loadingDialog = new LoadingDialog();
this.userCallback = userCallback;
this.swimLoginCallBack = swimLoginCallBack;
this.loginService = new LoginService(activity);
this.facebookConnector = new FacebookConnector(FACEBOOK_APPID,
activity, activity, new String[]{
"publish_stream", "email", "user_birthday", "read_stream", "offline_access"});
}
public void login() {
Session.initializeStaticContext(activity);
if (facebookConnector.getFacebook().isSessionValid()) {
facebookConnector.getFacebook().getSession()
.closeAndClearTokenInformation();
}
AuthListener listener = new AuthListener() {
#Override
public void onAuthSucceed() {
doLogin();
}
#Override
public void onAuthFail(String error) {
//(new MessageAlert()).showDialog("Facebook authetication fail\r\nError:" + error, activity);
}
};
SessionEvents.addAuthListener(listener);
facebookConnector.login();
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
facebookConnector.getFacebook().authorizeCallback(requestCode, resultCode, data);
}
private void doLogin() {
AsyncTaskBase<Void, Void, Void> t = new AsyncTaskBase<Void, Void, Void>(
activity) {
#Override
protected Void doInBackground(Void... params) {
mFacebookHandler.post(facebookUserInfoRunner);
return super.doInBackground(params);
}
#Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
}
};
t.execute();
}
final Runnable facebookUserInfoRunner = new Runnable() {
#Override
public void run() {
loadingDialog.showDialogLoading(activity);
Request.executeMeRequestAsync(facebookConnector.getFacebook()
.getSession(), new Request.GraphUserCallback() {
#Override
public void onCompleted(GraphUser user, Response response) {
SwimAccount currentAccount = ((SwimApp) activity.getApplication()).getCurrentAccount();
currentAccount.setAvatarUrl("https://graph.facebook.com/" + user.getId() + "/picture");
currentAccount.setIsLogin(true);
currentAccount.setFirstName(user.getFirstName());
currentAccount.setLastName(user.getLastName());
currentAccount.setStringId(user.getId());
currentAccount.setAccountType("facebook");
currentAccount.setEmail((String) response.getGraphObject().getProperty("email"));
currentAccount.setBirthdate(user.getBirthday());
currentAccount.setGender((String) response.getGraphObject().getProperty("gender"));
if (userCallback != null) {
userCallback.onCompleted(user, response);
}
loginService.login(currentAccount.getEmail(), "", currentAccount.getAccountType(), currentAccount.getStringId(), swimLoginCallBack);
//changeDialog.dismiss();
}
});
}
};
}
Found a solution to my problem. Try deleting the android:noHistory="true" from the Facebook login activity in your manifest. This messes with the authentication flow of the Session.
It looks like people on XDA have had this same problem.
They are claiming that you can try either of these:
(1) "Don't keep activities" option on Settings > Developer Options. If it's ON, then when an app calls some popup, system closes app, so then system restarts it ... and there got your loop.
(2) If you uninstall the Facebook App, you can then login through your app, and then re-install the Facebook app.
Not sure how "official" these answers are, but thought it might be worth a shot to you.
Sources:
http://forum.xda-developers.com/showthread.php?p=43200939 and http://forum.xda-developers.com/showthread.php?t=2186035

Salesforce Rest API with android - NullPointerException # AsyncRequestCallback

I'm trying to get the Salesforce REST API working with Android and new to android programming, followed the sample code to connect with SFDC http://wiki.developerforce.com/page/Getting_Started_with_the_Mobile_SDK_for_Android#Authentication
I'm trying to get a few records from SFDC and display them in the android app, looks like when the Async Call is made at "client.sendAsync(sfRequest, new AsyncRequestCallback()" - NullPointerException is thrown.
I did see a couple of similar issues online, but didn't help me. Hoping if some one would point me in the right direction to troubleshoot this. Thanks much.
public class GetAccountsActivity extends Activity {
private PasscodeManager passcodeManager;
private String soql;
private String apiVersion;
private RestClient client;
private TextView resultText;
private RestRequest sfRequest;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get Api Version
apiVersion = getString(R.string.api_version);
//Create Query
soql = "select id, name from Account limit 10";
// Setup view
setContentView(R.layout.get_accounts_activity);
((TextView) findViewById(R.id.Acc_Title)).setText(apiVersion);
// Passcode manager
passcodeManager = ForceApp.APP.getPasscodeManager();
}
#Override
public void onResume() {
super.onResume();
//Get SFClient
// Login options
String accountType = ForceApp.APP.getAccountType();
LoginOptions loginOptions = new LoginOptions(
null, // login host is chosen by user through the server picker
ForceApp.APP.getPasscodeHash(),
getString(R.string.oauth_callback_url),
getString(R.string.oauth_client_id),
new String[] {"api"});
new ClientManager(this, accountType, loginOptions).getRestClient(this, new RestClientCallback() {
#Override
public void authenticatedRestClient(RestClient client) {
if (client == null) {
ForceApp.APP.logout(GetAccountsActivity.this);
return;
}
GetAccountsActivity.this.client = client;
}
});
//Get Rest Object to query
try {
sfRequest = RestRequest.getRequestForQuery(apiVersion, soql);
//Use SF Rest Client to send the request
client.sendAsync(sfRequest, new AsyncRequestCallback(){
#Override
public void onSuccess(RestRequest request, RestResponse response){
//Check responses and display results
// EventsObservable.get().notifyEvent(EventType.RenditionComplete);
}//end onSuccess
#Override
public void onError(Exception exception) {
//printException(exception);
EventsObservable.get().notifyEvent(EventType.RenditionComplete);
}//End Exception for Async Method
});
}catch (UnsupportedEncodingException e) {
//printHeader("Could Send Query request");
//printException(e);
return;
}
}
}
enter code here
You are calling client.sendAsync from onResume() but client is not set until the authenticatedRestClient callback is called, you need to move your sendAsync call into the authenticatedRestClient callback.

Categories

Resources