parcel

How to get parcel or zipcode boundaries for display in map?

牧云@^-^@ 提交于 2019-12-31 09:07:11
问题 I want to add a boundary to a specified parcel of land so that it stands out in the map with a colored outline/border. In google maps, this is done using the polygon functionality if you know that path of coordinates to enter to surround the land parcel. However, I do not have the polygon path info, but I do have the both the geocode coordinates for the location and also the Assessor's Parcel Number (APN) for the parcel as well. I found this other SO post that talks a little about how to get

com.android.support:appcompat-v7 and design version 23.2.0 crash parcel error

不问归期 提交于 2019-12-30 07:13:07
问题 I'm using in my app several libraries from android support and i update them when they are available. During the test of the version 23.2.0, i've got a crash when i change the app permissions on android 6. As you know, when the user disable a permission, the app is recreated (same way as when the device rotate) and your parcelable objects are saved and restored from a bundle. With the version 23.2.0, when the app is recreated, i've got a parcel error. I think that this error is not from my

Resource leak in Android

空扰寡人 提交于 2019-12-25 01:46:20
问题 I have been developing an android app for a few weeks now and keep seeing this problem every now and again: 06-24 14:04:48.915 1530-1539/android.process.acore E/StrictMode﹕ A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. java.lang.Throwable: Explicit termination method 'close' not called at dalvik.system.CloseGuard.open(CloseGuard.java:184) at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java

Android - Parcel: unable to marshal value

☆樱花仙子☆ 提交于 2019-12-24 16:16:40
问题 I'm trying to pass data through activities with Parcelable. This is my code : public class Player implements Parcelable { public static final Parcelable.Creator<Player> CREATOR = new Parcelable.Creator<Player>() { public Player createFromParcel(Parcel in) { return new Player(in); } public Player[] newArray(int size) { return new Player[size]; } }; private String name; private List<Card> listCards; public Player(String namePlayer) { name = namePlayer; listCards = new ArrayList<>(); } private

Parcel write/read doesn't work in AndroidTestCase -why?

陌路散爱 提交于 2019-12-24 09:20:37
问题 I am trying to test to write to a Parcel in Android test but it doesnt't work. s==null! What is wrong? public class scraptest extends AndroidTestCase { public void test() { Parcel parcel=Parcel.obtain(); parcel.writeString("sdfsdf"); String s=parcel.readString(); } } 回答1: One must reset the Parcel's data position with: parcel.setDataPosition(0); 来源: https://stackoverflow.com/questions/22832403/parcel-write-read-doesnt-work-in-androidtestcase-why

Saving Parcelable data

社会主义新天地 提交于 2019-12-24 08:37:58
问题 I have a class which implements Parcelable, and could not implement Serializable because it contains some basic Android classes that I can not modify. Some of the objects in this class are for example Location and PendingIntent (which are all conveniently Parcelable). My problem is saving this information between the instances of my main Activity. Currently, I'm holding a static reference to this class, which works well. But I assume that when I re-install the app, and probably when updates

android nested object parceling

主宰稳场 提交于 2019-12-23 18:03:03
问题 how can we parcel nested object in an intent? . For example lets say there is an object A which contain one string variable and one another object B. now B contain object C . C contain a list of string. so how i can parcel object A in an intent. any help on this will be appreciated. thanks in advance. Implementation: public static class A { private B ObjectB; } public static class B { private String type; private List<C> C; } public static class C { private List<D> D; } public static class D

How to parcel List<Int> with kotlin

半世苍凉 提交于 2019-12-20 02:34:43
问题 I want to pass a data class (that contains list of int as a property) to other activity through Bundle and therefore i need to add Parcelable implementation to my data class. any idea about how to parcel this property? data class Test(val id: Long, val files: List<Int>?) : Parcelable { constructor(parcel: Parcel) : this( parcel.readLong(), TODO("files")) override fun writeToParcel(parcel: Parcel, flags: Int) { parcel.writeLong(id) } override fun describeContents(): Int { return 0 } companion

Shared memory region in NDK

梦想的初衷 提交于 2019-12-19 10:47:22
问题 I want to have a shared memory block (an ashmem region) that's mapped and accessed from native code. I also want this block to be used by several applications. I also want it to work on SDK level 7 (Android 2.1) There are two routes. I can create an ashmem region in native code; but then the question is - how do I pass an integer file descriptor to another process? You can marshal FileDescriptor objects via a Parcel , but there's no way to construct one around a raw FD. There's also

Parcelable where/when is describeContents() used?

☆樱花仙子☆ 提交于 2019-12-17 10:18:09
问题 Does anyone know where/when this method of a Parcelable is called? @Override public int describeContents() { return 0; } It has to be overriden. But should I consider doing something useful with it? 回答1: There is a constant defined in Parcelable called CONTENTS_FILE_DESCRIPTOR which is meant to be used in describeContents() to create bitmask return value. Description for CONTENTS_FILE_DESCRIPTOR in the API ref is: Bit masks for use with describeContents(): each bit represents a kind of object