안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요.
안드로이드 앱 개발을 시작한지 얼마 안되는 초보 입니다.
다름 아니라 제가 해보고 싶은것은
textView를 사용해서(꼭 TextView가 아니어도되겠지만. 제가 알고 있는건 그것밖에 없어서요;;)
실행을 시켰을때,
한줄 메세지가 나오고,
몇초뒤에 그 메세지가 사라지고,
다음줄에 또 다른 메세지가 나오구,
또 몇초뒤에 사라지고,
이효과를 만들어 보려고 합니다.
우선 스레드와 타이머를 생각해보았는데,,
제가 개념을 잘이해 못하고 있어서 그런지 잘 안되더라구요..
우선 타이머로했던 소스코드 붙여보겠습니다. ㅜㅜ
더 좋은 방법이나 소스코드에 대해 지적이나 수정좀 부탁드리겠습니다. 감사합니다!!
source code..
=============
public class HelloWorld extends Activity {
/** Called when the activity is first created. */
TextView tv1;
TextView tv2;
thread2 t2;
int a;
static int flowTime;
static int oldTime;
@Override
public void onCreate(Bundle savedInstanceState){
System.out.println("##########");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tv1 = (TextView)findViewById(R.id.TextView01);
tv2 = (TextView)findViewById(R.id.TextView02);
oldTime = (int) System.currentTimeMillis()/1000;
tv1.setText("Hello1");
while(flowTime<5)
{
flowTime = (int) System.currentTimeMillis()/1000;
}
if(flowTime>oldTime+3)
{
tv1.setVisibility(View.INVISIBLE);
}
안드로이드 앱 개발을 시작한지 얼마 안되는 초보 입니다.
다름 아니라 제가 해보고 싶은것은
textView를 사용해서(꼭 TextView가 아니어도되겠지만. 제가 알고 있는건 그것밖에 없어서요;;)
실행을 시켰을때,
한줄 메세지가 나오고,
몇초뒤에 그 메세지가 사라지고,
다음줄에 또 다른 메세지가 나오구,
또 몇초뒤에 사라지고,
이효과를 만들어 보려고 합니다.
우선 스레드와 타이머를 생각해보았는데,,
제가 개념을 잘이해 못하고 있어서 그런지 잘 안되더라구요..
우선 타이머로했던 소스코드 붙여보겠습니다. ㅜㅜ
더 좋은 방법이나 소스코드에 대해 지적이나 수정좀 부탁드리겠습니다. 감사합니다!!
source code..
=============
public class HelloWorld extends Activity {
/** Called when the activity is first created. */
TextView tv1;
TextView tv2;
thread2 t2;
int a;
static int flowTime;
static int oldTime;
@Override
public void onCreate(Bundle savedInstanceState){
System.out.println("##########");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tv1 = (TextView)findViewById(R.id.TextView01);
tv2 = (TextView)findViewById(R.id.TextView02);
oldTime = (int) System.currentTimeMillis()/1000;
tv1.setText("Hello1");
while(flowTime<5)
{
flowTime = (int) System.currentTimeMillis()/1000;
}
if(flowTime>oldTime+3)
{
tv1.setVisibility(View.INVISIBLE);
}




참고로 TextSwitcher, API Demos 의 views/Animation/ 안의 것들도 참고 해 보세요