<EditText
android:id="@+id/edit1"
android:layout_width="match_parent"
android:layout_height="wrap_content"

    />

<TextView

    android:id="@+id/text1"

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    android:text="smallBlueBig"

    android:textSize="30sp"

    android:bufferType="spannable"

     />

<TextView

    android:id="@+id/text2"

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    android:text="기타 태스트"

    android:textSize="30sp"

    android:linksClickable="true"

    android:textColorLink="#ffff00"

    android:bufferType="spannable"

     />

<Button

    android:id="@+id/arrow1"

    android:onClick="mOnClick"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:background="@drawable/cloud"

    android:textColor="#ff0000"

    android:text="ribbon"

    android:textSize="8pt"

    />

<Button

    android:id="@+id/arrow2"

    android:onClick="mOnClick"

    android:layout_width="200px"

    android:layout_height="100px"

    android:background="@drawable/cloud"

    android:textColor="#00ff00"

    android:text="ribbon"

    android:textSize="8pt"

    />

<Button

 

    android:id="@+id/arrow3"

    android:onClick="mOnClick"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:background="@drawable/ribbon"

    android:textColor="#0000ff"

    android:text="ribbon"

    android:textSize="8pt"

    />

<Button

    android:id="@+id/arrow4"

    android:onClick="mOnClick"

    android:layout_width="250px"

    android:layout_height="100px"

    android:background="@drawable/ribbon"

    android:textColor="#000000"

    android:text="ribbon"

    android:textSize="8pt"

    />

public class MainActivity extends AppCompatActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

}

public void mOnClick(View v){

    switch(v.getId()){

        case  R.id.arrow1:

            Toast.makeText(this,"arrow1 clicked",0).show();

            break;

        case  R.id.arrow2:

            Toast.makeText(this,"arrow2 clicked",0).show();

            break;

        case  R.id.arrow3:

            Toast.makeText(this,"arrow3 clicked",0).show();

            break;

    }

}

}

 

==================================================

package com.jproject.mysturdy;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

import java.lang.reflect.Array;
import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

   
@Override
   
protected void onCreate(Bundle savedInstanceState) {
       
super.onCreate(savedInstanceState);
        setContentView(
R.layout.activity_main);

       
ArrayAdapter<CharSequence> Adapter;
       
Adapter = ArrayAdapter.createFromResource(this, R.array.country, android.R.layout.simple_list_item_1);

       
ListView list = (ListView)findViewById(R.id.mylist);
       
list.setAdapter(Adapter);

       
list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
       
list.setDivider(new ColorDrawable(Color.YELLOW));
       
list.setDividerHeight(5);

    }

}

 

+ Recent posts