Buen dia
Tengo app que utiliza imagenes vectoriales .svg, pero al pasar de un activity a otro activity el app se trunca, esto es lo que arroja el logcat:
05-07 19:12:24.226 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 SSL3 alert read:W:CN warning close notify 05-07 19:12:24.226 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 NativeCrypto_SSL_interrupt 05-07 19:12:24.226 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 SSL3 alert write:W:CN warning close notify 05-07 19:12:24.228 16668-16989/matgic.com.matgic D/libc-netbsd: [getaddrinfo]: hostname=matgic.000webhostapp.com; servname=(null); netid=0; mark=0 05-07 19:12:24.228 16668-16989/matgic.com.matgic D/libc-netbsd: [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=4; ai_family=0 05-07 19:12:24.228 16668-16989/matgic.com.matgic D/libc-netbsd: [getaddrinfo]: hostname=matgic.000webhostapp.com; servname=(null); netid=0; mark=0 05-07 19:12:24.228 16668-16989/matgic.com.matgic D/libc-netbsd: [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0 05-07 19:12:24.420 16668-16989/matgic.com.matgic D/libc-netbsd: getaddrinfo: matgic.000webhostapp.com get result from proxy gai_error = 0 05-07 19:12:24.422 16668-16989/matgic.com.matgic D/Posix: [Posix_connect Debug]Process matgic.com.matgic :443 05-07 19:12:24.496 16668-16989/matgic.com.matgic D/libc-netbsd: [getaddrinfo]: hostname=matgic.000webhostapp.com; servname=(null); netid=0; mark=0 05-07 19:12:24.496 16668-16989/matgic.com.matgic D/libc-netbsd: [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=4; ai_family=0 05-07 19:12:24.497 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 NativeCrypto_SSL_do_handshake fd=0x9d0dcfb0 shc=0x9d0dcfb4 timeout_millis=2500 client_mode=1 npn=0x0 05-07 19:12:24.497 16668-16989/matgic.com.matgic D/NativeCrypto: doing handshake ++ 05-07 19:12:24.497 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 handshake start in CINIT before connect initialization 05-07 19:12:24.497 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 info_callback calling handshakeCompleted 05-07 19:12:24.497 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 info_callback completed 05-07 19:12:24.498 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 SSL_connect:error exit in 3RSH_A SSLv3 read server hello A 05-07 19:12:24.498 16668-16989/matgic.com.matgic D/NativeCrypto: doing handshake -- ret=-1 05-07 19:12:24.498 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 NativeCrypto_SSL_do_handshake ret=-1 errno=11 sslError=2 timeout_millis=2500 05-07 19:12:24.594 16668-16989/matgic.com.matgic D/NativeCrypto: doing handshake ++ 05-07 19:12:24.594 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 SSL_connect:error exit in 3RSC_A SSLv3 read server certificate A 05-07 19:12:24.594 16668-16989/matgic.com.matgic D/NativeCrypto: doing handshake -- ret=-1 05-07 19:12:24.595 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 NativeCrypto_SSL_do_handshake ret=-1 errno=11 sslError=2 timeout_millis=2500 05-07 19:12:24.606 16668-16989/matgic.com.matgic D/NativeCrypto: doing handshake ++ 05-07 19:12:24.606 16668-16989/matgic.com.matgic E/NativeCrypto: ssl=0xb8bd0de0 cert_verify_callback x509_store_ctx=0x9d0dcddc arg=0x0 05-07 19:12:24.607 16668-16989/matgic.com.matgic E/NativeCrypto: ssl=0xb8bd0de0 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA 05-07 19:12:24.626 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 cert_verify_callback => 1 05-07 19:12:24.644 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 SSL_connect:error exit in UNKWN SSLv3 read server session ticket A 05-07 19:12:24.644 16668-16989/matgic.com.matgic D/NativeCrypto: doing handshake -- ret=-1 05-07 19:12:24.644 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 NativeCrypto_SSL_do_handshake ret=-1 errno=11 sslError=2 timeout_millis=2500 05-07 19:12:24.720 16668-16989/matgic.com.matgic D/NativeCrypto: doing handshake ++ 05-07 19:12:24.720 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 handshake done in SSLOK SSL negotiation finished successfully 05-07 19:12:24.720 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 info_callback calling handshakeCompleted 05-07 19:12:24.721 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 info_callback completed 05-07 19:12:24.721 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 SSL_connect:ok exit in SSLOK SSL negotiation finished successfully 05-07 19:12:24.721 16668-16989/matgic.com.matgic D/NativeCrypto: doing handshake -- ret=1 05-07 19:12:24.721 16668-16989/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 NativeCrypto_SSL_get_certificate => NULL 05-07 19:12:25.083 16668-16687/matgic.com.matgic D/OpenGLRenderer: CanvasContext() 0xb8d0f738 05-07 19:12:25.113 16668-16668/matgic.com.matgic D/Surface: Surface::allocateBuffers(this=0xb8b47bb0) 05-07 19:12:25.113 16668-16687/matgic.com.matgic D/OpenGLRenderer: CanvasContext() 0xb8d0f738 initialize window=0xb8b47bb8, title=matgic.com.matgic/matgic.com.matgic.Digits2 05-07 19:12:25.113 16668-16687/matgic.com.matgic D/Surface: Surface::connect(this=0xb8b47bb0,api=1) 05-07 19:12:25.114 16668-16687/matgic.com.matgic W/libEGL: [ANDROID_RECORDABLE] format: 1 05-07 19:12:25.115 16668-16687/matgic.com.matgic D/mali_winsys: new_window_surface returns 0x3000 05-07 19:12:25.154 16668-16687/matgic.com.matgic D/OpenGLRenderer: CacheTexture 31 upload: x, y, width height = 20, 170, 140, 61 05-07 19:12:25.157 16668-16687/matgic.com.matgic I/[MALI][Gralloc]: [+]r_hnd(0xb8bf46f8), client(36), share_fd(55) 05-07 19:12:25.157 16668-16687/matgic.com.matgic D/GraphicBuffer: register, handle(0xb8bf46f8) (w:480 h:800 s:480 f:0x1 u:0x000b00) 05-07 19:12:25.168 16668-16687/matgic.com.matgic I/[MALI][Gralloc]: [+]r_hnd(0xb8c0de50), client(36), share_fd(62) 05-07 19:12:25.168 16668-16687/matgic.com.matgic D/GraphicBuffer: register, handle(0xb8c0de50) (w:480 h:800 s:480 f:0x1 u:0x000b00) 05-07 19:12:25.193 16668-16687/matgic.com.matgic I/[MALI][Gralloc]: [+]r_hnd(0xb8ba9c78), client(36), share_fd(63) 05-07 19:12:25.193 16668-16687/matgic.com.matgic D/GraphicBuffer: register, handle(0xb8ba9c78) (w:480 h:800 s:480 f:0x1 u:0x000b00) 05-07 19:12:25.197 16668-16687/matgic.com.matgic D/Surface: Surface::disconnect(this=0xb8b329c8,api=1) 05-07 19:12:25.199 16668-16687/matgic.com.matgic D/GraphicBuffer: unregister, handle(0xb8b34590) (w:480 h:800 s:480 f:0x1 u:0x000b00) 05-07 19:12:25.200 16668-16687/matgic.com.matgic I/[MALI][Gralloc]: [-]r_hnd(0xb8b34590), client(36), share_fd(61) 05-07 19:12:25.200 16668-16687/matgic.com.matgic D/GraphicBuffer: unregister, handle(0xb8d5f3f0) (w:480 h:800 s:480 f:0x1 u:0x000b00) 05-07 19:12:25.201 16668-16687/matgic.com.matgic I/[MALI][Gralloc]: [-]r_hnd(0xb8d5f3f0), client(36), share_fd(57) 05-07 19:12:25.202 16668-16687/matgic.com.matgic E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb8d6f098 05-07 19:12:25.202 16668-16687/matgic.com.matgic D/mali_winsys: [MALI] win=0xb8b329d0, native_buffer=0xb8d5e4b0, fd=-1 05-07 19:12:25.202 16668-16687/matgic.com.matgic D/GraphicBuffer: unregister, handle(0xb8d6f098) (w:480 h:800 s:480 f:0x1 u:0x000b00) 05-07 19:12:25.203 16668-16687/matgic.com.matgic I/[MALI][Gralloc]: [-]r_hnd(0xb8d6f098), client(36), share_fd(60) 05-07 19:12:25.203 16668-16687/matgic.com.matgic D/Surface: Surface::disconnect(this=0xb8b329c8,api=1) 05-07 19:17:24.852 16668-16717/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 NativeCrypto_SSL_interrupt 05-07 19:17:24.853 16668-16717/matgic.com.matgic D/NativeCrypto: ssl=0xb8bd0de0 SSL3 alert write:W:CN warning close notify
Este es el código de una de las activity
setContentView(R.layout.activity_digits);
txtscore=(TextView) findViewById(R.id.txtscore);
txtusername=(TextView) findViewById(R.id.txtusername);
btnyes=(Button) findViewById(R.id.btnyes);
btnno=(Button) findViewById(R.id.btnno);
logout=(TextView) findViewById(R.id.logout);
//id=(TextView) findViewById(R.id.userid);
//obtiene las variables de la clase User
Intent intent =getIntent();
score=intent.getStringExtra("scoreb");
username=intent.getStringExtra("usernameb");
userid=intent.getStringExtra("user_id");
txtscore.setText(score);
txtusername.setText(username);
//id.setText(userid);
img0=(ImageView) findViewById(R.id.img0);
img1=(ImageView) findViewById(R.id.img1);
img2=(ImageView) findViewById(R.id.img2);
img3=(ImageView) findViewById(R.id.img3);
question=(TextView) findViewById(R.id.question);
int color=Integer.parseInt(score);
if(color<=24)
{
txtscore.setTextColor(Color.parseColor("#ff0000"));
}
//SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.butterfly);
//img0.setImageDrawable(svg.createPictureDrawable());
//setContentView(img0);
//Resources res = getResources();
//Drawable mariposa = res.getDrawable(R.drawable.ic_butterfly);
//ImageView imageView = (ImageView)findViewById(R.id.myImageView9);
//imageView.setImageResource(R.drawable.ic_directions_white_48px);
//arreglo 1 de tipo entero para setear las imagenes en el mismo
//animales
int [] f1={R.drawable.ic_coconut, R.drawable.ic_comet, R.drawable.ic_dolphin, R.drawable.ic_eagle};
Random r1=new Random();
int a1=r1.nextInt(4);
img0.setImageResource(f1[a1]);
int [] f2={R.drawable.ic_butterfly, R.drawable.ic_bird, R.drawable.ic_cat, R.drawable.ic_germanshepharddog};
Random r2=new Random();
int a2=r2.nextInt(4);
img1.setImageResource(f2[a2]);
//arreglo 3 (astros)
int [] f3={R.drawable.ic_apple, R.drawable.ic_appletree, R.drawable.ic_rosered, R.drawable.ic_seal};
Random r3=new Random();
int a3=r3.nextInt(4);
img2.setImageResource(f3[a3]);
int [] f4={R.drawable.ic_tiger, R.drawable.ic_star, R.drawable.ic_rooster, R.drawable.ic_rainbow};
Random r4=new Random();
int a4=r4.nextInt(4);
img3.setImageResource(f4[a4]);
//arreglo de cadenas de texto
int [] f5={R.string.bike, R.string.radio,R.string.shoe, R.string.jersey};
Random r5=new Random();
int a5=r5.nextInt(4);
question.setText(f5[a5]);
logout.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View view)
{
Intent logout = new Intent(Digits.this, MainActivity.class);
Digits.this.startActivity(logout);
}//fin de método onclick
});//fin de register setonclick
//método para el button btnno
btnno.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View view)
{
int score2=Integer.parseInt(score);
score2+=1;
final int scoreaux=score2;
final String usernameaux=username;
final int useraux=Integer.parseInt(userid);
Response.Listener<String> responseListener= new Response.Listener<String>()
{
@Override
public void onResponse(String response)
{
try
{
JSONObject jsonResponse=new JSONObject(response);
boolean success= jsonResponse.getBoolean("success");
Log.i("MiTag", "El valor retornado es:" + jsonResponse);
if(success)
{
//Int scoreaux=jsonResponse.getInt("score");
//Int useraux=jsonResponse.getInt("user_id");
Intent intent=new Intent (Digits.this, Digits2.class);
intent.putExtra("id_user", useraux);
intent.putExtra("username", usernameaux);
intent.putExtra("score", scoreaux);
Digits.this.startActivity(intent);
}
else
{
AlertDialog.Builder builder=new AlertDialog.Builder(Digits.this);
builder.setMessage("User or Id incorrect")
.setNegativeButton("Retry", null)
.create().show();
}
}
catch (JSONException e)
{
e.printStackTrace();
}
}//fin de método onResponse
};//fin de Response.Listener<String>
ScoreRequest scoreRequest= new ScoreRequest(useraux,usernameaux,scoreaux, responseListener);
RequestQueue queue= Volley.newRequestQueue(Digits.this);
queue.add(scoreRequest);
}//fin de onclick
});//fin de setOnClickListener
//fin de método btnno
btnyes.setOnClickListener(new View.OnClickListener()//encabezado del objeto onclicklistener
{
@Override
public void onClick(View view)//encabezado de método
{
int score2=Integer.parseInt(score);
score2-=1;
final int scoreaux=score2;
final String usernameaux=username;
final int useraux=Integer.parseInt(userid);
Response.Listener<String> responseListener= new Response.Listener<String>()
{
@Override
public void onResponse(String response)
{
try
{
JSONObject jsonResponse=new JSONObject(response);
boolean success= jsonResponse.getBoolean("success");
Log.i("MiTag", "El valor retornado es:" + jsonResponse);
if(success)
{
//int scoreaux=jsonResponse.getInt("score");
//int useraux=jsonResponse.getInt("user_id");
Intent intent=new Intent (Digits.this, Digits2.class);
intent.putExtra("id_user", useraux);
intent.putExtra("username", usernameaux);
intent.putExtra("score", scoreaux);
Digits.this.startActivity(intent);
}
else
{
AlertDialog.Builder builder=new AlertDialog.Builder(Digits.this);
builder.setMessage("User or Id incorrect")
.setNegativeButton("Retry", null)
.create().show();
}
}
catch (JSONException e)
{
e.printStackTrace();
}
}//fin de método onResponse
};//fin de Response.Listener<String>
ScoreRequest scoreRequest= new ScoreRequest(useraux,usernameaux,scoreaux, responseListener);
RequestQueue queue= Volley.newRequestQueue(Digits.this);
queue.add(scoreRequest);
}//fin de onclick
});//fin de setOnClickListener
//fin de método del button btn yes
}//fin de oncreate
@Override
public void onBackPressed()
{
}
}