0
I’m using this example:
try {
AssetManager assetManager = getResources().getAssets();
InputStream inputStream = assetManager.open("nome-do-arquivo.txt");
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String linha;
while((linha = bufferedReader.readLine())!=null){
nome = linha;
id = bufferedReader.readLine() // Aqui é um tipo inteiro
}
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
In the arquivo txt
is like this
fulano
R.drawble.image
I would like how to do R.drawble.image
store in a whole type because I tried to convert String
for int
but it didn’t work out.
You want to store a text in a variable
int
?– Jéf Bueno
@jbueno is not that, it is time to read write to an integer type variable
int
– Vale
@jbueno
R.drawable.image
he’s the whole kind– Vale