diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..c83a369
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/langlearn/MessageActivity.java b/app/src/main/java/com/example/langlearn/MessageActivity.java
index 7ddde1d..8816c55 100644
--- a/app/src/main/java/com/example/langlearn/MessageActivity.java
+++ b/app/src/main/java/com/example/langlearn/MessageActivity.java
@@ -3,12 +3,71 @@
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
-public class MessageActivity extends AppCompatActivity {
+import com.parse.GetCallback;
+import com.parse.ParseException;
+import com.parse.ParseObject;
+import com.parse.ParseQuery;
+public class MessageActivity extends AppCompatActivity {
+ EditText text;
+ Button send;
+ Button retrieve;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_message);
+ int userCount = 1;
+ String[] Users = new String[userCount];
+ text = findViewById(R.id.editTextTextMultiLine);
+ send = findViewById(R.id.sendButton);
+ retrieve = findViewById(R.id.buttonRetrieve);
+ send.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ text = findViewById(R.id.editTextTextMultiLine);
+ TextView textView = findViewById(R.id.textView2);
+ ParseObject firstObject = new ParseObject("FirstClass");
+ firstObject.put("Message", text.getText().toString());
+ firstObject.saveInBackground(e -> {
+ if (e != null) {
+ textView.setText(String.format("Fail to add data..." + e.getLocalizedMessage(), firstObject.get("Message")));
+ }
+ else {
+ textView.setText(String.format("Data saved is: \n %s", firstObject.get("Message")));
+ }
+ });
+ }
+ });
+ retrieve.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getMessage();
+ }
+ });
+ }
+
+ void getMessage(){
+ ParseQuery query = ParseQuery.getQuery("FirstClass");
+ query.whereEqualTo("objectId", "Uv2xUdlOdi");
+ query.getFirstInBackground(new GetCallback() {
+ public void done(ParseObject message, ParseException e) {
+ if (e == null) {
+ String Message = message.getString("Message");
+ Log.e("GFSDGSFDGFDSGFSD", "done: " + Message );
+ } else {
+ // Something is wrong
+ }
+ }
+ });
}
+
+
+
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_message.xml b/app/src/main/res/layout/activity_message.xml
index 5bef9df..4c558bb 100644
--- a/app/src/main/res/layout/activity_message.xml
+++ b/app/src/main/res/layout/activity_message.xml
@@ -27,14 +27,34 @@
android:text="Send"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.461"
+ app:layout_constraintHorizontal_bias="0.78"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextMultiLine"
- app:layout_constraintVertical_bias="0.719" />
+ app:layout_constraintVertical_bias="0.403" />
+
+
+
+
+
-
\ No newline at end of file