[Solved] Add signature to pdf with itext

Use itext pdfstamper to write the signature. FileOutputStream os = new FileOutputStream(destFileName); PdfStamper stamper = new PdfStamper(reader, os); Where reader is the sec file reader then once you have got the stamper. PdfPatternPainter painter = stamper.getOverContent(1).createPattern(200, 150); painter.setColorFill(BaseColor.ORANGE); painter.beginText(); painter.setTextMatrix(AffineTransform.getTranslateInstance(0, 50)); painter.setFontAndSize(BaseFont.createFont(), 70); painter.showText(waterMarkString); painter.endText(); for (int i = reader.getNumberOfPages(); i > 0; i–) { … Read more

[Solved] Replace Activity in Manifest.xml

You must change your manifest: <?xml version=”1.0″ encoding=”utf-8″?> <manifest xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” package=”bizsalt.drawer2″> <application android:allowBackup=”true” android:icon=”@mipmap/gargi_blue” android:label=”@string/app_name” android:theme=”@style/AppTheme”> <activity android:name=”.SplashScreenActivity” android:label=”XYZ” android:theme=”@style/AppTheme”> <intent-filter> <action android:name=”android.intent.action.MAIN” /> <category android:name=”android.intent.category.LAUNCHER” /> </intent-filter> </activity> <activity android:name=”.LoginActivity” android:label=”XYZ” android:theme=”@style/AppTheme” /> <activity android:name=”.RegisterActivity” android:label=”XYZ” android:theme=”@style/AppTheme” /> <activity android:name=”.MainActivity” android:label=”XYZ” android:theme=”@style/AppTheme” /> </application> </manifest> And in your SplashScreenActivity. Put code to transit … Read more

[Solved] Android Studio – org.json.JSONObject cannot be converted to JSONArray

Ok, so here what i did to fixed my problem: PHP ….//Some query from mysql table $posts = array(); //Added foreach($data as $row) { $posts[] = array(‘post’=>$row); //New }echo json_encode(array(‘posts’=>$posts)); //then print here ANDROID JAVA JSONObject json = new JSONObject(response); JSONArray jArray = json.getJSONArray(“posts”); for (int i = 0; i < jArray.length(); i++) { JSONObject … Read more

[Solved] Android: Why can’t I move to another Acivity by using “Intent”?

When you call the method “createNewUser()”, you are inside of an onClickListener. When you pass in ‘this’ as your context, you are passing in the context of your listener. Instead, when calling createNewUser, use ‘MainActivity.this’ as your Context, so then your app knows that the context is the whole activity and not just the listener. … Read more

[Solved] retrieving one string value from cursor

Change your string query by adding the Where condition like so String selectQuery = “SELECT some_column FROM ” + AI_TABLE + ” WHERE some_field = ?” ; Then just add a selection argument when you query the DB Cursor c = db.rawQuery (selectQuery, new String[] {“SOME_VALUE”} ); This will only return some_column to the cursor … Read more

[Solved] RecyclerView not displaying in Fragment

You have not Override the Methods which are necessary for fragment. You should find some tutorials on Fragment first,rather using protected method onCreateView you should override its public method. public class RecyclerViewFrag extends Fragment { private List<Person> persons; private RecyclerView rv; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.recyclerview_activity, container, false); … Read more

[Solved] How to get data from fragment to another activity? (Not container activity) [duplicate]

if you’re routing from fragment to another activity, you can put you data into the intent using the putExtra and then receive in the activity using getExtra. Inside the fragment, Intent profileActivityIntent = new Intent(context,ProfileActivity.class); profileActivityIntent.putExtra(“dataKey”,data); startActivity(profileActivityIntent); And then inside the ProfileActivity’s onCreate method, //assuming that data is a string String dataFromFragment = getIntent().getStringExtra(“dataKey”); Log.i(“Data … Read more

[Solved] Parse JSON objects(lat and lng) in GoogleMap as markers

Please have a look at this line: for(Shop shop : this.response.shops){ map.addMarker(new MarkerOptions().position(new LatLng(shop.getShopLat(), shop.getShopLng())).title(shop.getShopAddress())); } In this line you want to create a new LatLng() object by adding into constructor an array instead of one value, change this line into: for(Shop shop : this.response.shops){ //remember to check is shop.getShopLat() is not null etc.. for(int … Read more

[Solved] What is the difference build types: nightly,release,debug,dev [closed]

Generally those will have different amounts of debugging/optimizations/obfuscations in them… debug – signed with the debug key, debuggable, not proguarded release – signed with the release key, not debuggable, proguarded The terms nightly & dev don’t have standard definitions, but probably something like: dev – maybe configured to point to an internal server for testing, … Read more