public class SendFeedbackTask extends ConnectionTask<Void,Void,HashMap<String,String>>
Copyright (c) 2011-2014 Bit Stadium GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Constructor and Description |
---|
SendFeedbackTask(android.content.Context context,
String urlString,
String name,
String email,
String subject,
String text,
List<android.net.Uri> attachmentUris,
String token,
android.os.Handler handler,
boolean isFetchMessages)
Send feedback
AsyncTask . |
Modifier and Type | Method and Description |
---|---|
void |
attach(android.content.Context context) |
void |
detach() |
protected HashMap<String,String> |
doInBackground(Void... args) |
protected void |
onPostExecute(HashMap<String,String> result) |
protected void |
onPreExecute() |
void |
setLastMessageId(int lastMessageId) |
void |
setShowProgressDialog(boolean showProgressDialog) |
getStringFromConnection
public SendFeedbackTask(android.content.Context context, String urlString, String name, String email, String subject, String text, List<android.net.Uri> attachmentUris, String token, android.os.Handler handler, boolean isFetchMessages)
AsyncTask
.
If the class is intended to send a simple feedback message, the a POST is made with the specific data
If the class is intended to fetch the messages by providing a token, a GET is madecontext
- Context
objecturlString
- URL for sending feedback/fetching messagesname
- Name of the feedback senderemail
- Email of the feedback sendersubject
- Message subjecttext
- The messageattachmentUris
- List of all attached filestoken
- Token received after sending the first feedback. This should be stored in SharedPreferences
handler
- Handler object to send data back to the activityisFetchMessages
- If true, the AsyncTask
will perform a GET, fetching the messages.
If false, the AsyncTask
will perform a POST, sending the feedback messagepublic void setShowProgressDialog(boolean showProgressDialog)
public void setLastMessageId(int lastMessageId)
public void attach(android.content.Context context)
public void detach()
protected void onPreExecute()
Copyright © 2015. All Rights Reserved.