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 theContactZendeskFragment
This 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
,ContactZendeskActivity
can 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_OK
a request was successfully submitted. -
If resultCode is
Activity#RESULT_CANCELED
and data is null, the activity was dismissed by the user. -
If resultCode is
Activity#RESULT_CANCELED
and 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.String
EXTRA_CONTACT_CONFIGURATION
This extra is used to pass a concrete implementation ofZendeskFeedbackConfiguration
.static java.lang.String
RESULT_ERROR_IS_NETWORK_ERROR
static java.lang.String
RESULT_ERROR_REASON
static java.lang.String
RESULT_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 void
onCreate(Bundle savedInstanceState)
protected void
onDestroy()
void
onNetworkAvailable()
This is called when network connectivity is available and you should be able to carry out network requests.void
onNetworkUnavailable()
This is called when network connectivity is unavailable and network requests are expected to fail.boolean
onOptionsItemSelected(MenuItem item)
static void
startActivity(Context context, ZendeskFeedbackConfiguration configuration)
Start theContactZendeskActivity
with 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 theContactZendeskActivity
with 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:
onCreate
in classNetworkAwareActionbarActivity
-
onDestroy
protected void onDestroy()
-
onOptionsItemSelected
public boolean onOptionsItemSelected(MenuItem item)
-
onNetworkAvailable
public void onNetworkAvailable()
Description copied from class:NetworkAwareActionbarActivity
This 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:
onNetworkAvailable
in interfaceNetworkAware
- Overrides:
onNetworkAvailable
in classNetworkAwareActionbarActivity
-
onNetworkUnavailable
public void onNetworkUnavailable()
Description copied from class:NetworkAwareActionbarActivity
This is called when network connectivity is unavailable and network requests are expected to fail.- Specified by:
onNetworkUnavailable
in interfaceNetworkAware
- Overrides:
onNetworkUnavailable
in classNetworkAwareActionbarActivity
-
-