Hello I have a bunch of text on my file which i display. I used the Hello World demo to insert this text. Now Whenever i try to edit main.xml it doesn't happen. If anybody knows why that would be cool but I want to know how to add simple scrolling to my text. I don't think I need to use main.xml right. Is there a way I can just add it to my project?
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class manifesto extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Make a new text view passing Activity object
TextView tv = new TextView(this);
//Set a text into view
tv.setText("A bunch of text.");
tv.setTextSize(12);
//set the view into activity view container
setContentView(tv);
}
}
Here is the XML file in case you want to see it.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:text="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@string/hello"></TextView>
</LinearLayout>