android findViewById is null in LinearLayout

Uncategorized
Question: android findViewById method return value is null this view is custom class view.xml view activity java (Fragment) @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.view, container, false); mBefore = (MemberBeforeLoginView)rootView.findViewById(R.id.view_before_login); mAfter = (MemberAfterLoginView)rootView.findViewById(R.id.view_after_login); mBefore.SetStateListener(this); mAfter.SetStateListener(this); route(); return rootView; } inside xml is view_mypage_before_login.xml com.main.view.MemberAfterLoginView.java public class MemberAfterLoginView extends LinearLayout implements View.OnClickListener, MemberViewListener.MemberChildViewInterface { private MemberViewListener mMemberListener = null; private Button mBtnLogout = null; public MemberAfterLoginView(Context context) { super(context); initialize(context); } public MemberAfterLoginView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); initialize(context); } public MemberAfterLoginView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); initialize(context); } private void initialize(Context context) { /*LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflater.inflate(R.layout.view_mypage_after_login, null); */ mBtnLogout = (Button) findViewById(R.id.logout); } ... why null variable…
Read More

How to use custom html/dialog to post content on Facebook

Uncategorized
Question: The below code open a Facebook created dialog , everything works fine, only i want instead of Facebook dialog my custom dialog should prompt. fb: FacebookService params: UIParams ={ method: 'feed', name: "Hello", link: "abc.com", caption: 'R$ '+"caption", } this.fb.ui(params) .then((res) => console.log(res)) .catch((e: any) => console.error(e)); Answer: Read more
Read More

Qstore – Product Landing Page

Uncategorized
Qstore – Single Products Landing Page HTML Template.One is an awesome product landing page HTML template to present your product in front of your desired customers.The template comes with all basic pages for an Onepage Product Showcase: About us, product, testimonials, contact. It’s using the power of HTML5, CSS3, Bootstrap 3 to build up the template. .
Read More

How to pass Unicode characters as JSP/Servlet request.getParameter?

Uncategorized
Question: After a lot of trial and error I still can't figure out the problem. The JSP, servlet, and database are all set to accept UTF-8 encoding, but even still whenever I use request.getParameter on anything that has any two-byte characters like the em dash they get scrambled up as broken characters. I've made manual submissions to the database and it's able to accept these characters, no problem. And if I pull the text from the database in a servlet and print it in my jsp page's form it displays no problem. The only time I've found that it comes back as broken characters is when I try and display it elsewhere after retrieving it using request.getParameter. Has anyone else had this problem? How can I fix it? Answer: That…
Read More

How to check a python script (test.py)is running or not on windows 10

Uncategorized
Question: I'm trying to setup a socket connection between Python and PHP. Python will function as server and PHP as client. I have a python script (test.py) running form PHP. `python test.py` how to check this (test.py) is running or not each time before running that from PHP.how to stop that if this script is running. how can I check that this script(test.py) is running or not in task manager or anywhere else? on windows10. Answer: This is unorthodox, but if you want to handle a basic lock in Windows CMD, you can change your execution line to:dir .lock || echo lock > .lock && python test.py && del .lock This code will create a lock file if it does not exist, and start the python script. If the lock…
Read More