Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试测试以在 Android 测试中写入 Parcel,但它不起作用。s==空!怎么了?
public class scraptest extends AndroidTestCase { public void test() { Parcel parcel=Parcel.obtain(); parcel.writeString("sdfsdf"); String s=parcel.readString(); } }
必须使用以下命令重置 Parcel 的数据位置: parcel.setDataPosition(0);