Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.4 kB
2
Indexable
Never
package com.example.spenapp;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;


public class MainActivity extends AppCompatActivity {
    private Context context;
    private TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        context = this;
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                int id = view.getId();
                switch (id) {
                    case R.id.EN:
                       openLanguageSelect_1();
                        break;
                    case R.id.VN:
                        openLanguageSelect_2();
                        break;
                }
            }
        });
    }

    private void openLanguageSelect_1(){
        Intent intent = new Intent(context, SelectLanguageActivity.class);
        startActivity(intent);
    }
    private void openLanguageSelect_2(){
        Intent intent = new Intent(context, SelectLanguageActivity.class);
        startActivity(intent);
    }
}