How can I use true type font in my TextView?
I tried to implement "Font Awesome" reffering this source
I did these procedure but my Application shut down as soon as it lauches.
What was wrong with this?
I copied values/attrs.xml. and pasted to my application(No changes in
content)
I copied content of values/strings.xml, and pasted into strings.xml in my
App.
I copied both layouts/icon.xml and grid.xml, and pasted into my App(No
changes in content)
I copied assets/icons.ttf, and pasted into my App(No changes in content.
It's a font file)
I copied src/com.example.IconView/IconView.java to my App(No changes in
content)
I added these lines into my MainActivity.java
setContentView(R.layout.grid);
GridView grid = (GridView) findViewById(R.id.gridview);
grid.setAdapter(ArrayAdapter.createFromResource(this, R.array.icons,
R.layout.icon));
Then my current code looks like this
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setContentView(R.layout.grid);
GridView grid = (GridView) findViewById(R.id.gridview);
grid.setAdapter(ArrayAdapter.createFromResource(this, R.array.icons,
R.layout.icon));
mActionBar = getActionBar();
mActionBar.hide();
However, my app shut downs automatically as soon as it lauched.
How can I fix these, and enable font awesome?
No comments:
Post a Comment