Android Open Source - EasyVote Ask Question






From Project

Back to project page EasyVote.

License

The source code is released under:

Apache License

If you think the Android project EasyVote listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.llanox.mobile.easyvote;
/*from www.j  a va  2s. c o  m*/
import java.util.Date;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.backendless.Backendless;
import com.backendless.async.callback.BackendlessCallback;
import com.llanox.mobile.easyvote.data.DataLayerManager;
import com.llanox.mobile.easyvote.data.DataSession;
import com.llanox.mobile.easyvote.data.QuestionData;
import com.llanox.mobile.easyvote.model.Question;

public class AskQuestion extends Activity {

  protected static final String TAG = AskQuestion.class.getSimpleName();



  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_ask_question);
    
  
  
  }
  
  
  
  public void askQuestion(View view){
    
    //Save question and send broadcast
    String question = ((EditText) this.findViewById(R.id.et_question)).getText().toString();
    
    if(question.isEmpty()){
      Toast.makeText(this, R.string.toast_msg_requeried_text, Toast.LENGTH_LONG).show();
      return;
    }
    
    Question oQuestion = new Question();
    oQuestion.setCreator(null);
    oQuestion.setContent(question);
    
    DataSession<Question> data = new QuestionData(this);
    data.insert(oQuestion);
  
    Toast.makeText(this, R.string.toast_msg_saved_question, Toast.LENGTH_LONG).show();
    Intent intent = new Intent(this,QuestionListActivity.class);
    this.startActivity(intent);
    this.finish();
    
  }



  @Override
  public void onBackPressed() {
        
    Intent intent = new Intent(this,QuestionListActivity.class);
    this.startActivity(intent);
    this.finish();
  }
  
  
  
}




Java Source Code List

com.llanox.mobile.easyvote.AnswerQuestionDetailActivity.java
com.llanox.mobile.easyvote.AnswerQuestionDetailFragment.java
com.llanox.mobile.easyvote.AnswerQuestionListActivity.java
com.llanox.mobile.easyvote.AnswerQuestionListFragment.java
com.llanox.mobile.easyvote.AppCredentials.java
com.llanox.mobile.easyvote.AppSessionManager.java
com.llanox.mobile.easyvote.AskQuestion.java
com.llanox.mobile.easyvote.ConstantsEasyVote.java
com.llanox.mobile.easyvote.EntryPointActivity.java
com.llanox.mobile.easyvote.PlusBaseActivity.java
com.llanox.mobile.easyvote.QuestionDetailActivity.java
com.llanox.mobile.easyvote.QuestionDetailFragment.java
com.llanox.mobile.easyvote.QuestionListActivity.java
com.llanox.mobile.easyvote.QuestionListFragment.java
com.llanox.mobile.easyvote.data.DataException.java
com.llanox.mobile.easyvote.data.DataLayerManager.java
com.llanox.mobile.easyvote.data.DataSession.java
com.llanox.mobile.easyvote.data.QuestionData.java
com.llanox.mobile.easyvote.data.UserData.java
com.llanox.mobile.easyvote.data.util.DateTimeUtils.java
com.llanox.mobile.easyvote.model.AnswerQuestion.java
com.llanox.mobile.easyvote.model.Question.java
com.llanox.mobile.easyvote.model.User.java