-6

I am doing reverse engineering in an App to translate it to my local language I would like to display a Toast message to be displayed when you open the App on Android

Example Toast text "translated by Crypton" <<< I want to put this message on Toast

Scott Stensland
  • 26,870
  • 12
  • 93
  • 104
Crypton
  • 1
  • 1

2 Answers2

0

XML file:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/custom_toast_container"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="8dp"
        android:background="#DAAA"
        >

    <TextView android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#FFF"
        />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>

Java file:

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        String str="Welcome TO MSIT";enter code here
        Toast.makeText(getApplicationContext(), str, Toast.LENGTH_LONG).show();
    }
}
Pang
  • 9,564
  • 146
  • 81
  • 122
-1
String str="translated by Crypton";
Toast.makeText(getApplicationContext(), str, Toast.LENGTH_LONG).show();
Irshad
  • 3,071
  • 5
  • 30
  • 51