0
Good guys, in this app I intend to do a test inserting a vector image in the main Activity.
I did the integration process all right, as you can see:
But even having followed the entire tutorial, the following error appears, so that you can not even run the app:
Mainactivity:
package genesysgeneration.ruleoftree;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.larvalabs.svgandroid.SVG;
import com.larvalabs.svgandroid.SVGParser;
public class Main01Activity extends AppCompatActivity implements View.OnClickListener{
private EditText et01, et02, et03;
private TextView tv01, tvTest;
private double l01, l02, l03, equalizer, lxx;
private Button btnChange01, btnCompras, btnMoeda;
private ImageView logo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main01);
logo.setBackgroundColor(Color.WHITE);
SVG svg = SVGParser.getSVGFromAsset(getResources(), R.raw.tree);
logo.setImageDrawable(svg.createPictureDrawable());
setContentView(logo);
tvTest=(TextView)findViewById(R.id.tvTest);
tv01=(TextView)findViewById(R.id.tv01);
tvTest.setText(String.valueOf(0));
tv01.setText(String.valueOf(0));
}
}
OBS - I didn’t transcribe all the code as they must have perceived, because there is no need, since the rest is function smooth.
Tutorial in question (video) => Integrate SVG => (website) Android Coffe
I’ve changed, I’ve made a mistake. it was supposed to be SVG svg = Svgparser.getSVGFromResource(getResources(), R.raw.Tree); now you can run, but the app for out of nowhere. I’ll look at the android monitor
– Boneco Sinforoso
gave an exception to what you told me to do, I’ll put it
– Boneco Sinforoso
if you know English, go here ó: http://blog.fordemobile.com/2013/01/display-svg-inside-imageview.html
– Armando Marques Sobrinho