| 241 | } |
| 242 | |
| 243 | void CinderNativeActivity::launchTwitter( const std::string& text, const Surface8u* surf ) |
| 244 | { |
| 245 | std::string pathStr = ""; |
| 246 | if( nullptr != surf ) { |
| 247 | try { |
| 248 | cinder::fs::path path = getCacheDirectory() / "launchTwitter_tmp_image.png"; |
| 249 | pathStr = path.string(); |
| 250 | cinder::writeImage( path, *surf ); |
| 251 | } |
| 252 | catch( const std::exception& e ) { |
| 253 | dbg_app_error( std::string( "launchTwitter temp image write failed: " ) + e.what() ); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | jstring jstrText = JniHelper::Get()->NewStringUTF( text ); |
| 258 | jstring jstrPath = JniHelper::Get()->NewStringUTF( pathStr ); |
| 259 | JniHelper::Get()->CallVoidMethod( getInstance()->getJavaObject(), Java::launchTwitter, jstrText, jstrPath ); |
| 260 | JniHelper::Get()->DeleteLocalRef( jstrText ); |
| 261 | JniHelper::Get()->DeleteLocalRef( jstrPath ); |
| 262 | } |
| 263 | |
| 264 | |
| 265 | }}} // namespace cinder::android::app |
nothing calls this directly
no test coverage detected