Skip to content

Instantly share code, notes, and snippets.

View khalid-mahmood's full-sized avatar

Khalid Mahmood khalid-mahmood

View GitHub Profile
@khalid-mahmood
khalid-mahmood / AnyWhere.java
Created August 1, 2018 08:54 — forked from akexorcist/AnyWhere.java
Singleton Sound Player in Android
SoundPoolManager.getInstance().play(getContext(), R.raw.any_sound);
MediaPlayerManager.getInstance().play(getContext(), R.raw.any_sound);
@khalid-mahmood
khalid-mahmood / URLConnection Get Request
Created May 26, 2017 10:05
Make Simple Http request using UrlConnection android
/**
* @param in
* @return
*/
private String readStream(InputStream in) {
BufferedReader reader = null;
StringBuffer response = new StringBuffer();
try {
reader = new BufferedReader(new InputStreamReader(in));
String line = "";
@khalid-mahmood
khalid-mahmood / Expandable ListView Group Indicator
Last active May 11, 2017 12:05
Expandable ListView Group indicator Solution
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
String headerTitle = (String) getGroup(groupPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this._context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.expandable_list_group, null);
}
@khalid-mahmood
khalid-mahmood / Scrollable Google Map
Created April 5, 2017 11:33
Add Google Map to Scroll View
package com.example.widgets;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;