Search code examples
androidandroid-roomandroid-internal-storage

how can pass byte array one activity to another android


How can pass byte array one activity to another android

is possible pass large byte array or bitmap or image pass from intent


Solution

  • It depends on size and kind of the data. You can pass it by your bundle intent but maybe you will have an exception of marshaling the array see doc here.Or You can pass an entire object from your application class like this:

    public class MyApp extends MultiDexApplication {
    private Currency currencyMined;
    public Currency getCurrencyMined(String name) {
    
        return PrefHelper.getObjectVal(name, Currency.class);
    }
    
    public void setCurrencyMined(String name, Currency currencyMined) {
        this.currencyMined = currencyMined;
    
    }