1. AndroidManifest.xml // 인터넷 권한 설정 // 홈페이지 접속 오류 방지 android:usesCleartextTraffic="true" 2. activity_main.xml // 웹뷰 컴포넌트 넣기 3. MainActivity.java // 웹뷰 컴포넌트 연결 및 동작 import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends AppCompatActivity { pr..
// 종료 DialogInterface.OnClickListener mExitClick = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if(which == DialogInterface.BUTTON1) finish(); else return; } }; @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch(keyCode){ case KeyEvent.KEYCODE_BACK: new AlertDialog.Builder(LieDetectorActivity.this) .setTitle("프로그..
// main.xml // SpeechToTextActivity.java package pkg.SpeechToText; import java.util.ArrayList; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.speech.RecognizerIntent; import android.view.View; import android.widget.Button; import android.widget.EditText; public class SpeechToTextActivity extends Activity { private static final int REQUEST_COD..
package pkg.WavPlay; import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.view.View; import android.widget.Button; public class WavPlayActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); findVie..
final ProgressDialog proDlg = new ProgressDialog(this); proDlg.setTitle("데이터 받아 오는중 ..."); proDlg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); proDlg.setMax(DataCount); proDlg.show(); Thread t = new Thread() { int i = public void run() { while(true) { proDlg.setProgress(i); i++; } } proDlg.dismiss();
- Total
- Today
- Yesterday