Class ContactZendeskActivity
- java.lang.Object
-
- AppCompatActivity
-
- com.zendesk.sdk.ui.NetworkAwareActionbarActivity
-
- com.zendesk.sdk.feedback.ui.ContactZendeskActivity
-
- All Implemented Interfaces:
- NetworkAware, Retryable
public class ContactZendeskActivity extends NetworkAwareActionbarActivity
This activity will show theContactZendeskFragmentThis activity sets the action bar to display a back icon and treats this in the same way as a hardware back press.
As it is not possible to attach a
SubmissionListener,ContactZendeskActivitycan be initiated by callingActivity#startActivityForResult(android.content.Intent, int).
The result will be delivered toActivity#onActivityResult(int, int, android.content.Intent)and can be interpreted in the following way:- If resultCode is
Activity#RESULT_OKa request was successfully submitted. -
If resultCode is
Activity#RESULT_CANCELEDand data is null, the activity was dismissed by the user. -
If resultCode is
Activity#RESULT_CANCELEDand data is not null, an error occurred.
The exact reason of the error is stored in data. Use the following keys to acquire it:ContactZendeskActivity.RESULT_ERROR_REASON(String),ContactZendeskActivity.RESULT_ERROR_IS_NETWORK_ERROR(boolean),ContactZendeskActivity.RESULT_ERROR_STATUS_CODE(int)
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringEXTRA_CONTACT_CONFIGURATIONThis extra is used to pass a concrete implementation ofZendeskFeedbackConfiguration.static java.lang.StringRESULT_ERROR_IS_NETWORK_ERRORstatic java.lang.StringRESULT_ERROR_REASONstatic java.lang.StringRESULT_ERROR_STATUS_CODE-
Fields inherited from class com.zendesk.sdk.ui.NetworkAwareActionbarActivity
mNetworkAvailable
-
-
Constructor Summary
Constructors Constructor and Description ContactZendeskActivity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected voidonCreate(Bundle savedInstanceState)protected voidonDestroy()voidonNetworkAvailable()This is called when network connectivity is available and you should be able to carry out network requests.voidonNetworkUnavailable()This is called when network connectivity is unavailable and network requests are expected to fail.booleanonOptionsItemSelected(MenuItem item)static voidstartActivity(Context context, ZendeskFeedbackConfiguration configuration)Start theContactZendeskActivitywith the supplied configuration.-
Methods inherited from class com.zendesk.sdk.ui.NetworkAwareActionbarActivity
onPause, onResume, onRetryAvailable, onRetryUnavailable
-
-
-
-
Field Detail
-
RESULT_ERROR_REASON
public static final java.lang.String RESULT_ERROR_REASON
- See Also:
- Constant Field Values
-
RESULT_ERROR_STATUS_CODE
public static final java.lang.String RESULT_ERROR_STATUS_CODE
- See Also:
- Constant Field Values
-
RESULT_ERROR_IS_NETWORK_ERROR
public static final java.lang.String RESULT_ERROR_IS_NETWORK_ERROR
- See Also:
- Constant Field Values
-
EXTRA_CONTACT_CONFIGURATION
public static final java.lang.String EXTRA_CONTACT_CONFIGURATION
This extra is used to pass a concrete implementation ofZendeskFeedbackConfiguration.You must ensure that you are not passing an anonymous implementation of ZendeskFeedbackConfiguration because this may cause a crash when you are trying to add the extra to the intent, if the enclosing class is not serializable. You can use
ContactZendeskActivity.startActivity(Context, ZendeskFeedbackConfiguration)to ensure that the configuration is wrapped by a concrete class.- See Also:
- Constant Field Values
-
-
Method Detail
-
startActivity
public static void startActivity(Context context, ZendeskFeedbackConfiguration configuration)Start theContactZendeskActivitywith the supplied configuration.- Parameters:
context- A valid context, used to start the contextconfiguration- The configuration to use for contacting Zendesk. Default configuration will be used if null.
-
onCreate
protected void onCreate(Bundle savedInstanceState)
- Overrides:
onCreatein classNetworkAwareActionbarActivity
-
onDestroy
protected void onDestroy()
-
onOptionsItemSelected
public boolean onOptionsItemSelected(MenuItem item)
-
onNetworkAvailable
public void onNetworkAvailable()
Description copied from class:NetworkAwareActionbarActivityThis is called when network connectivity is available and you should be able to carry out network requests.If you override this method make sure to call super.onNetworkAvailable if you want the no network view to be dismissed
- Specified by:
onNetworkAvailablein interfaceNetworkAware- Overrides:
onNetworkAvailablein classNetworkAwareActionbarActivity
-
onNetworkUnavailable
public void onNetworkUnavailable()
Description copied from class:NetworkAwareActionbarActivityThis is called when network connectivity is unavailable and network requests are expected to fail.- Specified by:
onNetworkUnavailablein interfaceNetworkAware- Overrides:
onNetworkUnavailablein classNetworkAwareActionbarActivity
-
-