Expression expected help android studio -
package com.example.android.game; import android.graphics.typeface; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.widget.textview; public class main2activity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main2); typeface font = typeface.createfromasset(getassets(), “gill.ttf”); textview tv=(textview) findviewbyid(r.id.textview0); tv.settypeface(font); } }
just before "gill.ttf"); , after (getassets(), expects expression, don't know , i'm new programmer :)
the error comes part of code:
typeface font = typeface.createfromasset(getassets(), “gill.ttf”); ^ ^ these culprit
in other word: it's “
s used in code. compiler doesn't understand interpreted wrong syntaxes.
here how should it:
typeface font = typeface.createfromasset(getassets(), "gill.ttf");
note how stackoverflow's syntax highlighter doesn't recognize first example (the 1 used in code) proper string
declaration , how understands second 1 (thus highlighting red/maroon-ish color).
hope help!
Comments
Post a Comment