ANDROID
-
[ANDROID] RETROFIT2 파일 + 텍스트 전송ANDROID 2020. 1. 17. 11:12
서버 Controller @RequestMapping(value="/app/uploadFile.do", method = {RequestMethod.GET, RequestMethod.POST}) public @ResponseBody Object uploadFile(MultipartHttpServletRequest request) throws Exception{ ModelAndView mv = new ModelAndView("jsonView"); System.out.println("test===" + request.getParameter("test")); return mv; } 앱 RetrofitService.java import java.util.LinkedHashMap; import java.util.L..
-
[ANDROID] 이전 Activity 로 데이터 전송하기ANDROID 2020. 1. 8. 10:12
activity_main.xml MainActivity.java package com.example.sampleintent; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class MainActivity extends AppCompatActivity { public static final int REQUEST_CODE_MENU = 10..
-
[ANDROID] 동적 layout 추가 삭제(LayoutInflater)ANDROID 2020. 1. 7. 17:26
LayoutInflater을 이용하여 동적 layout 추가, 삭제를 한다. activity_menu.xml sub1.xml MenuActivity.java package com.example.samplelayoutinflater; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.CheckBox; import android.widget.LinearLayout; p..
-
[ANDROID] MainActivity.java 에서 다른 xml ID 호출(LayoutInflater)ANDROID 2020. 1. 7. 14:44
LayoutInflater를 이용하여 다른 xml를 제어할 수 있다. package com.example.sampletoast; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onC..