목록Android (8)
하고재비
MainActivity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 public class MainActivity extends AppCompatActivity { String ss; // 전송값 저장 UserInfo userInfo; Gson gson = new GsonBuilder().create(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); try { ss = new Select().execute("").get(..
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667public class JsonPaser extends AsyncTask { private URL url; private String URL_Address = "~~~/TestDB.jsp"; public String getRes() { return res; } public void setRes(String res) { this.res = res; } private String res; @Override protected void onPreExecute() { super.onPreExe..
Activity 123456789101112131415161718192021222324252627282930313233343536373839 import android.support.design.widget.TabLayout;import android.support.v4.view.ViewPager;import android.support.v7.app.AppCompatActivity;import android.os.Bundle; public class Insert_Product extends AppCompatActivity{ TabLayout sliding_tab; ViewPager pager; @Override protected void onCreate(Bundle savedInstanceState) {..
만들어두면 편할것같아서 구현함. class의 이름을 String 으로 받고, intent시 바로 사용할수 있음. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111..
void getRunActivity() { ActivityManager activity_manager = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); List task_info = activity_manager.getRunningTasks(9999); for(int i=0; i
주의. project structure -> dependencies 에서 cardview 와 recyclerview 에 대한 라이브러리 추가를 선행할것. new StaggeredGridLayoutManager(2, LinearLayoutManager.VERTICAL);에서 int 변수가 2냐 3이냐 에 따라서 아래와 같은 결과가 나옴. 리사이클러뷰 StaggeredGrid MainActivity.java123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778public class MainActivit..
MainActivity.java 123456789101112131415161718import android.support.v4.app.ListFragment;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.widget.ArrayAdapter; public class MainActivity extends AppCompatActivity { static final String[] LIST_MENU = {"LIST1", "LIST2", "LIST3"} ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(saved..
EditText에 .setText를 int로 하니 에러... 1 2 3 4 5 6 7 8 9 10 div.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { int num1 = Integer.parseInt(input_number1.getText().toString()); int num2 = Integer.parseInt(input_number2.getText().toString()); int res = div(num1,num2); String res = Integer.toString(plus(num1,num2)); result.setText(res); } }); Colored by Color ..