-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainActivity.java
65 lines (46 loc) · 1.79 KB
/
MainActivity.java
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
package com.example.mark.SongFeed;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.style.TypefaceSpan;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity{
public final static int RETURN = 0;
public final static int OTHER = 1;
public final static int FEED = 2;
TextView messageTextView;
//Button getMessageButton;
Button otherButton;
Button feed;
Typeface typeface;
TypefaceSpan typefaceSpan;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
messageTextView = (TextView) findViewById(R.id.textView);
setTitle("SongFeed");
//getMessageButton = (Button) findViewById(R.id.button);
otherButton = (Button) findViewById(R.id.other);
feed = (Button) findViewById(R.id.feed);
typeface = Typeface.createFromAsset(getAssets(), "fonts/Sawasdee.ttf");
messageTextView.setTypeface(typeface);
otherButton.setOnClickListener(new View.OnClickListener() {
//@Override
public void onClick(View v) {
Intent getResult = new Intent(getApplicationContext(), MusicPlayingActivity.class);
startActivityForResult(getResult, OTHER);
}
});
feed.setOnClickListener(new View.OnClickListener(){
//@Override
public void onClick(View v) {
Intent getResult = new Intent(getApplicationContext(), SubActivity.class);
startActivityForResult(getResult, FEED);
}
});
}
}