Skip to content

Instantly share code, notes, and snippets.

<plurals name="x_guests">
<item quantity="one">@string/x_guests_one</item>
<item quantity="few">@string/x_guests_few</item>
<item quantity="many">@string/x_guests_many</item>
<item quantity="other">@string/x_guests_other</item>
</plurals>
<string name="x_guests_few">%1$d guests</string>
<string name="x_guests_many">%1$d guests</string>
<string name="x_guests_one">%1$d guest</string>
<plurals name="x_guests">
<item quantity="one">%1$d guest</item>
<item quantity="few">%1$d guests</item>
<item quantity="many">%1$d guests</item>
<item quantity="other">%1$d guests</item>
</plurals>
public void onListingInfoPanelClick(View view) {
Intent dynamicIntent;
try {
dynamicIntent = new Intent(this, Class.forName("PropertyDetailsActivity"));
dynamicIntent.putExtra("listing", listing);
startActivity(dynamicIntent);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
public void onListingInfoPanelClick(View view) {
Intent dynamicIntent;
try {
dynamicIntent = new Intent(this, Class.forName("PropertyDetailsActivity"));
dynamicIntent.putExtra("listing", listing);
startActivity(dynamicIntent);
} catch (ClassNotFoundException e) {
// Broken world
}
}
<string name="special_offer_format">You have been offered a %1$d night stay for %2$d guest%3$s starting %4$s for %5$s.</string>
String message = getString(R.string.special_offer_format,
nights,
guestCount,
(guestCount == 1 ? "" : "s"),
(new SimpleDateFormat("yyyy-MM-dd")).format(checkinDate),
"$" + String.valueOf(offerPrice));
@lxdvs
lxdvs / gist:5815774
Created June 19, 2013 16:38
SSL_select_next_proto still faults during GoogleAuthUtil operations using OkHttp
I/LSS-II: ( 2919): proc out:com.google.android.gsf.login,adj=0,i=85
I/LSS-II: ( 2919): proc wait in:com.sec.chaton,adj=11LRU num=86,i=64
F/libc (22262): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 22321 (AsyncTask #2)
I/DEBUG ( 2456): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
D/STATUSBAR-NetworkController( 3128): onReceive() - RSSI_CHANGED_ACTION, WIFI_STATE, NETWORK_STATE
D/STATUSBAR-NetworkController( 3128): refreshSignalCluster: data=-1 bt=false
I/DEBUG ( 2456): Build fingerprint: 'samsung/ja3gub/ja3g:4.2.2/JDQ39/I9500UBUAMDK:user/release-keys'
I/DEBUG ( 2456): Revision: '10'
I/DEBUG ( 2456): pid: 22262, tid: 22321, name: AsyncTask #2 >>> com.airbnb.android <<<
I/DEBUG ( 2456): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
TLDR: Good news! The fix for multiupload is on development. Bonus, the fix actually made the entire app snappier. AirbnbRequest now has an override method that fixes the world.
In case I die/forget, I'd like to catalog this multiple request bug, because shit got pretty real.
We observed multiple photo copies being uploaded with a single request, as well as multiple listings being created in listings/create. However, our app logging and Volley-level network debug information indicated that only one request was being sent. Curious!
Thankfully, a few weeks ago we put in the capability to hook our emulated app up to Vagrant. I added some debug logging on the local dev, and did in fact see two incoming requests. Since I trust our server way more than our app, I decided to look harder at the client.
To make a really long story short, I kept debugging ang logging until I finally got down way down into OkHttp (Square's HTTP lib, http://square.github.io/okhttp/) and from there I could step-debug no longer. Okhttp w
it
Process: com.airbnb.android, PID: 4638
E java.lang.RuntimeException: Unable to start activity ComponentInfo{com.airbnb.android/com.airbnb.android.activities.MainActivity}: java.lang.NullPointerEx
ception
E at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
E at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
E at android.app.ActivityThread.access$800(ActivityThread.java:135)
E at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E at android.os.Handler.dispatchMessage(Handler.java:102)
E at android.os.Looper.loop(Looper.java:136)
E at android.app.ActivityThread.main(ActivityThread.java:5017)